Update rental_contract.py
This commit is contained in:
parent
ad796ca618
commit
bf6e554853
|
|
@ -68,13 +68,16 @@ class RentalContract(models.Model):
|
|||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
_order = "id desc"
|
||||
|
||||
@api.depends('date_to','state')
|
||||
|
||||
@api.depends('date_to', 'state')
|
||||
def _compute_is_today_end_date(self):
|
||||
for record in self:
|
||||
record.is_today_end_date = record.date_to <= date.today()
|
||||
if record.state=='renewed':
|
||||
if record.date_to and isinstance(record.date_to, date):
|
||||
record.is_today_end_date = record.date_to <= date.today()
|
||||
if record.state == 'renewed':
|
||||
record.is_today_end_date = False
|
||||
|
||||
|
||||
@api.onchange('rent_method')
|
||||
def onchange_rent_method(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue