Browse Source

[FIX] singleton error

pull/124/head
Cybrosys Technologies 7 years ago
committed by GitHub
parent
commit
d3b71f4568
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      bank_reconciliation/models/account_move_line.py

12
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
return res

Loading…
Cancel
Save