From 3faa6e31f709ad711f153f756ed2e2f36223f6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 17 Dec 2024 10:22:36 +0100 Subject: [PATCH] [FIX] account_reconcile_analytic_tag: Avoid error when accessing the reconciliation view Steps to reproduce the error: - Go to Accounting Dashboard - Click on the Reconcile X items button of the bank journal --- .../models/account_reconcile_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/account_reconcile_analytic_tag/models/account_reconcile_model.py b/account_reconcile_analytic_tag/models/account_reconcile_model.py index 7c086d9b8..6448392c8 100644 --- a/account_reconcile_analytic_tag/models/account_reconcile_model.py +++ b/account_reconcile_analytic_tag/models/account_reconcile_model.py @@ -14,7 +14,8 @@ def _get_write_off_move_lines_dict(self, residual_balance, partner_id): if len(res) == 0: return res currency = self.company_id.currency_id - for index, line in enumerate(self.line_ids): + index = 0 + for line in self.line_ids: if line.amount_type == "percentage": balance = currency.round(residual_balance * (line.amount / 100.0)) elif line.amount_type == "fixed": @@ -28,6 +29,7 @@ def _get_write_off_move_lines_dict(self, residual_balance, partner_id): continue res[index]["manual_analytic_tag_ids"] = [(6, 0, line.analytic_tag_ids.ids)] + index += 1 return res