From 7dd87ac7d05897a124d78f7b3fd8357ccf7154c8 Mon Sep 17 00:00:00 2001 From: sbejaoui Date: Fri, 22 Nov 2024 11:46:38 +0100 Subject: [PATCH] [FIX] product_contract: add sol name dependes --- product_contract/models/sale_order_line.py | 9 ++++++++- .../models/sale_order_line_contract_mixin.py | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) 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",