diff --git a/account_reconcile_restrict_partner_mismatch/README.rst b/account_reconcile_restrict_partner_mismatch/README.rst
index 8d2f43c86..39a8e1267 100644
--- a/account_reconcile_restrict_partner_mismatch/README.rst
+++ b/account_reconcile_restrict_partner_mismatch/README.rst
@@ -98,6 +98,7 @@ Other credits
-------------
The migration of this module from 13.0 to 14.0 was financially supported
+The migration of this module from 16.0 to 18.0 was financially supported
by Camptocamp
Maintainers
diff --git a/account_reconcile_restrict_partner_mismatch/models/account_move_line.py b/account_reconcile_restrict_partner_mismatch/models/account_move_line.py
index ae875e325..756fe6df7 100644
--- a/account_reconcile_restrict_partner_mismatch/models/account_move_line.py
+++ b/account_reconcile_restrict_partner_mismatch/models/account_move_line.py
@@ -1,7 +1,6 @@
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
-
-from odoo import _, models
+from odoo import models
from odoo.exceptions import UserError
@@ -21,18 +20,18 @@ def _check_partner_mismatch_on_reconcile(self):
in ("asset_receivable", "liability_payable")
)
- def reconcile(self):
+ def _reconcile_plan(self, reconciliation_plan):
# to be consistent with parent method
- if self:
+ if reconciliation_plan:
partners = set()
- for line in self:
- if line._check_partner_mismatch_on_reconcile:
- partners.add(line.partner_id.id)
+ for lines in reconciliation_plan:
+ checked_lines = lines.filtered(lambda l: l._check_partner_mismatch_on_reconcile)
+ partners.update(line.partner_id.id for line in checked_lines)
if len(partners) > 1:
raise UserError(
- _(
+ self.env._(
"The partner has to be the same on all"
" lines for receivable and payable accounts!"
)
)
- return super().reconcile()
+ return super()._reconcile_plan(reconciliation_plan)
diff --git a/account_reconcile_restrict_partner_mismatch/readme/CREDITS.md b/account_reconcile_restrict_partner_mismatch/readme/CREDITS.md
index 4351fe296..5dfda7ecb 100644
--- a/account_reconcile_restrict_partner_mismatch/readme/CREDITS.md
+++ b/account_reconcile_restrict_partner_mismatch/readme/CREDITS.md
@@ -1,2 +1,3 @@
The migration of this module from 13.0 to 14.0 was financially supported
+The migration of this module from 16.0 to 18.0 was financially supported
by Camptocamp
diff --git a/account_reconcile_restrict_partner_mismatch/report/account_move_lines_report.xml b/account_reconcile_restrict_partner_mismatch/report/account_move_lines_report.xml
index c5930500e..fa294e360 100644
--- a/account_reconcile_restrict_partner_mismatch/report/account_move_lines_report.xml
+++ b/account_reconcile_restrict_partner_mismatch/report/account_move_lines_report.xml
@@ -4,7 +4,7 @@
Reconciled items with partner mismatch
account.reconcile.partner.mismatch.report
-
+
@@ -17,7 +17,7 @@
-
+
@@ -57,7 +57,7 @@
>
Reconciled items with partner mismatch
account.reconcile.partner.mismatch.report
- tree,form
+ list,form