Browse Source

[FIX] - check date_start before onchange

pull/207/head
sbejaoui 6 years ago
parent
commit
288a0e9810
  1. 2
      contract/models/contract_line.py

2
contract/models/contract_line.py

@ -82,6 +82,7 @@ class AccountAnalyticInvoiceLine(models.Model):
def _compute_state(self):
today = fields.Date.context_today(self)
for rec in self:
if rec.date_start:
if rec.is_canceled:
rec.state = 'canceled'
elif today < rec.date_start:
@ -202,6 +203,7 @@ class AccountAnalyticInvoiceLine(models.Model):
"""Date end should be auto-computed if a contract line is set to
auto_renew"""
for rec in self.filtered('is_auto_renew'):
if rec.date_start:
rec.date_end = (
self.date_start
+ self.get_relative_delta(

Loading…
Cancel
Save