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