# HG changeset patch
# User Etienne Ferriere <etienne.ferriere@xcg-consulting.fr>
# Date 1689178239 -7200
#      Wed Jul 12 18:10:39 2023 +0200
# Branch 11.0
# Node ID 4d21f6add6d983c3df6e84bafe49678b2400fc8e
# Parent  f798beb38f86b26f09a91f01b646a83bcce689cf
On accounting entry reconciliation, the restriction to one partner associated to
reconciled entries can be deactivated, using a context key.

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1,3 +1,9 @@
+11.0.1.5.0
+==========
+
+* On accounting entry reconciliation, the restriction to one partner associated
+  to reconciled entries can be deactivated, using a context key.
+
 11.0.1.4.0
 ==========
 
diff --git a/__manifest__.py b/__manifest__.py
--- a/__manifest__.py
+++ b/__manifest__.py
@@ -21,7 +21,7 @@
 {
     "name": "Accounting Reports",
     "license": "AGPL-3",
-    "version": "11.0.1.4.0",
+    "version": "11.0.1.5.0",
     "category": "Accounting",
     "author": "XCG Consulting",
     "website": "https://odoo.consulting/",
diff --git a/models/account_move_line.py b/models/account_move_line.py
--- a/models/account_move_line.py
+++ b/models/account_move_line.py
@@ -73,7 +73,10 @@
                     "all entries!"
                 )
             )
-        if len(set(partners)) > 1:
+        if (
+            self.env.context.get("control_partner", True)
+            and len(set(partners)) > 1
+        ):
             raise UserError(_("Entries are not of the same partner!"))
         if len(set(all_accounts)) > 1:
             raise UserError(_("Entries are not of the same account!"))
diff --git a/wizards/account_monthly_statement_gen.py b/wizards/account_monthly_statement_gen.py
--- a/wizards/account_monthly_statement_gen.py
+++ b/wizards/account_monthly_statement_gen.py
@@ -113,7 +113,7 @@
         amount = 0.0
         line_count = 0
         partner_set = set()
-        for line_id, partner_id, line_amount in self._find_entries():
+        for _line_id, partner_id, line_amount in self._find_entries():
             amount += line_amount
             line_count += 1
             partner_set.add(partner_id)