From be64ba60694a2498e1f023d722775b299554cb85 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 30 Nov 2017 16:50:46 +0100 Subject: [PATCH] =?UTF-8?q?[FIX]=20account:=20reconciliation=20of=20paymen?= =?UTF-8?q?t=20with=20statement=20should=20not=20ta=E2=80=A6=20=E2=80=A6ke?= =?UTF-8?q?=20lock=20date=20into=20account?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we have a payment in october and a statement in november and the lock date is 1st november, we can't reconcile both because we try to write statement_id on payment but there is the lockdate constraint. This is not correct and we should be able to reconcile both even after lock date as it is the case for other moves. --- 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 158a5a0404e..b602e2832f3 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -883,7 +883,7 @@ class AccountBankStatementLine(models.Model): total = self.amount for aml_rec in payment_aml_rec: total -= aml_rec.debit - aml_rec.credit - aml_rec.write({'statement_line_id': self.id}) + aml_rec.with_context(check_move_validity=False).write({'statement_line_id': self.id}) counterpart_moves = (counterpart_moves | aml_rec.move_id) # Create move line(s). Either matching an existing journal entry (eg. invoice), in which