From 25d70fc5c9a7b409251a76bd9e681ec665fc258c Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Mon, 27 Jan 2020 14:22:57 +0000 Subject: [PATCH] [FIX] account: account.bank.statement.cashbox multi record creation account.bank.statement.cashbox model is verified at create/write and updated accordingly but may crash on multiple record creation/update. The `for` loop on `self` didn't use the specific records yielded but the `self` recordset. closes odoo/odoo#45116 X-original-commit: af8367734c69dfeb0a1e1f029009f6da98449d0b Signed-off-by: Victor Feyens (vfe) --- addons/account/models/account_bank_statement.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 124484fc9ce..521bd89cea2 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -91,10 +91,10 @@ class AccountBankStmtCashWizard(models.Model): def _validate_cashbox(self): for cashbox in self: - if self.start_bank_stmt_ids: - self.start_bank_stmt_ids.write({'balance_start': self.total}) - if self.end_bank_stmt_ids: - self.end_bank_stmt_ids.write({'balance_end_real': self.total}) + if cashbox.start_bank_stmt_ids: + cashbox.start_bank_stmt_ids.write({'balance_start': cashbox.total}) + if cashbox.end_bank_stmt_ids: + cashbox.end_bank_stmt_ids.write({'balance_end_real': cashbox.total}) class AccountBankStmtCloseCheck(models.TransientModel):