Update end_rental_contract

This commit is contained in:
zainab2097 2024-09-05 21:17:23 +03:00 committed by GitHub
parent 2a38c653a0
commit 71541d72a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -81,6 +81,9 @@ class EndOfRent(models.Model):
def get_remain_amount(self):
for rec in self:
rec.remain_amount = rec.insurance_amount - rec.total_amount
def action_draft (self):
self.write({'state': 'draft'})
def action_cancel(self):
if self.state not in ['check', 'done']: