|
|
@ -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( |
|
|
|