mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] - check date_start before onchange
This commit is contained in:
committed by
Francisco Ivan Anton Prieto
parent
d71261e919
commit
70c7b6fe1c
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user