From 9af45ffa0526f546d6554f1cb23dc89a1995f3ec Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 26 Feb 2016 14:16:27 +0100 Subject: [PATCH] [FIX] account: post move in reconciliation When an analytic account is specified in the reconciliation, the analytic lines are not created. This is because the account move is posted before the account move lines are actually created. Fixes #10951 opw-670110 --- addons/account/models/account_bank_statement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 31065200ce4..bea4fa4e57c 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -818,7 +818,6 @@ class AccountBankStatementLine(models.Model): move_name = (self.statement_id.name or self.name) + "/" + str(self.sequence) move_vals = self._prepare_reconciliation_move(move_name) move = self.env['account.move'].create(move_vals) - move.post() counterpart_moves = (counterpart_moves | move) # Complete dicts to create both counterpart move lines and write-offs @@ -871,5 +870,6 @@ class AccountBankStatementLine(models.Model): new_aml = aml_obj.with_context(check_move_validity=False).create(aml_dict) (new_aml | counterpart_move_line).reconcile() + move.post() counterpart_moves.assert_balanced() return counterpart_moves