diff --git a/product_contract/models/sale_order_line.py b/product_contract/models/sale_order_line.py index 7cd316c79c..bcbd6e06f5 100644 --- a/product_contract/models/sale_order_line.py +++ b/product_contract/models/sale_order_line.py @@ -202,7 +202,14 @@ def _set_contract_line_start_date(self): start_date = start_date + relativedelta(day=31) line.date_start = start_date - @api.depends("product_id") + @api.depends( + "product_id", + "contract_start_date_method", + "date_start", + "date_end", + "recurring_rule_type", + "recurring_invoicing_type", + ) def _compute_name(self): res = super()._compute_name() for line in self: diff --git a/product_contract/models/sale_order_line_contract_mixin.py b/product_contract/models/sale_order_line_contract_mixin.py index bf521d9588..2497f4cd2b 100644 --- a/product_contract/models/sale_order_line_contract_mixin.py +++ b/product_contract/models/sale_order_line_contract_mixin.py @@ -64,11 +64,13 @@ class SaleOrderLineContractMixin(models.AbstractModel): compute="_compute_contract_line_date_start", store=True, readonly=False, + precompute=True, ) date_end = fields.Date( compute="_compute_contract_line_date_end", store=True, readonly=False, + precompute=True, ) contract_line_id = fields.Many2one( comodel_name="contract.line",