[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) <vfe@odoo.com>
This commit is contained in:
Victor Feyens
2020-02-11 16:16:05 +00:00
parent fe7b0e828f
commit 25d70fc5c9
@@ -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):