diff --git a/models/payment_transaction.py b/models/payment_transaction.py index 3217f00..8092f48 100755 --- a/models/payment_transaction.py +++ b/models/payment_transaction.py @@ -32,7 +32,16 @@ class PaymentTransaction(models.Model): string='Online payment', copy=False, readonly=True) reference2=fields.Char('type',compute='compute_reference') + + invoice_bug=fields.Boolean(string="invoice bug", compute='_compute_invoice_bug',store=True) + def _compute_invoice_bug(self): + for rec in self: + rec.invoice_bug=False + for invoice in rec.invoice_ids: + if rec.state in ['done','authorized'] and invoice.payment_state!='paid' and invoice.state=='posted': + rec.invoice_bug=True + def compute_reference(self): for rec in self: rec.reference2='Participation'