From 469fbf44f9d16d940477c310072313900be687de Mon Sep 17 00:00:00 2001 From: Francisco Ivan Anton Prieto Date: Mon, 19 Apr 2021 10:17:31 +0200 Subject: [PATCH] [14.0][FIX] account_reconciliation_widget: already posted move issue on reconcile A new mod in Odoo base code disallows re-post an already posted move. This thing blocks reconciling and this commit fixes it. --- .../models/account_bank_statement.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/account_reconciliation_widget/models/account_bank_statement.py b/account_reconciliation_widget/models/account_bank_statement.py index 0916d919..0a5993d6 100644 --- a/account_reconciliation_widget/models/account_bank_statement.py +++ b/account_reconciliation_widget/models/account_bank_statement.py @@ -252,7 +252,10 @@ class AccountBankStatementLine(models.Model): aml_to_reconcile.append((new_aml, counterpart_move_line)) # Post to allow reconcile - self.move_id.with_context(skip_account_move_synchronization=True).action_post() + if self.move_id.state != "posted": + self.move_id.with_context( + skip_account_move_synchronization=True + ).action_post() # Reconcile new lines with counterpart for new_aml, counterpart_move_line in aml_to_reconcile: @@ -262,7 +265,6 @@ class AccountBankStatementLine(models.Model): # Needs to be called manually as lines were created 1 by 1 self.move_id.update_lines_tax_exigibility() - self.move_id.with_context(skip_account_move_synchronization=True).action_post() # record the move name on the statement line to be able to retrieve # it in case of unreconciliation self.write({"move_name": self.move_id.name})