From d3b71f456884a93716b377df522e046c240e861d Mon Sep 17 00:00:00 2001 From: Cybrosys Technologies Date: Mon, 11 Feb 2019 16:07:23 +0530 Subject: [PATCH] [FIX] singleton error --- bank_reconciliation/models/account_move_line.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bank_reconciliation/models/account_move_line.py b/bank_reconciliation/models/account_move_line.py index 603030222..6c2db6c9e 100644 --- a/bank_reconciliation/models/account_move_line.py +++ b/bank_reconciliation/models/account_move_line.py @@ -12,11 +12,13 @@ class AccountMoveLine(models.Model): def write(self, vals): if not vals.get("statement_date"): vals.update({"reconciled": False}) - if self.payment_id and self.payment_id.state == 'reconciled': - self.payment_id.state = 'posted' + for record in self: + if record.payment_id and record.payment_id.state == 'reconciled': + record.payment_id.state = 'posted' elif vals.get("statement_date"): vals.update({"reconciled": True}) - if self.payment_id: - self.payment_id.state = 'reconciled' + for record in self: + if record.payment_id: + record.payment_id.state = 'reconciled' res = super(AccountMoveLine, self).write(vals) - return res \ No newline at end of file + return res