Update rent_payment.py
This commit is contained in:
parent
d4687989ec
commit
5a1af8e77d
|
|
@ -51,6 +51,12 @@ class RentPayment(models.Model):
|
|||
invoice_id = fields.Many2one('account.move', string="Invoice",readonly=1)
|
||||
note = fields.Text(string="Note")
|
||||
|
||||
def read(self, records):
|
||||
res = super(RentPayment, self).read(records)
|
||||
if self.invoice_id.payment_state in ['paid','in_payment']:
|
||||
rec.write({'state': 'paid'})
|
||||
return res
|
||||
|
||||
@api.depends('invoice_id', 'invoice_id.state', 'invoice_id.amount_residual')
|
||||
def get_invoice_state(self):
|
||||
self.paid = False
|
||||
|
|
|
|||
Loading…
Reference in New Issue