Skip to content

Commit

Permalink
[IMP] product_contract: Make computed fields as precompute to be able…
Browse files Browse the repository at this point in the history
… to use them on _compute_name method
  • Loading branch information
CarlosRoca13 committed Jan 27, 2025
1 parent ffa3e67 commit 4f6bd60
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions product_contract/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ class SaleOrderLine(models.Model):
recurring_invoicing_type = fields.Selection(
related="product_id.recurring_invoicing_type"
)
date_start = fields.Date(compute="_compute_date_start", readonly=False, store=True)
date_end = fields.Date(compute="_compute_date_end", readonly=False, store=True)
date_start = fields.Date(
compute="_compute_date_start", readonly=False, store=True, precompute=True
)
date_end = fields.Date(
compute="_compute_date_end", readonly=False, store=True, precompute=True
)
contract_line_id = fields.Many2one(
comodel_name="contract.line",
string="Contract Line to replace",
Expand All @@ -50,6 +54,7 @@ class SaleOrderLine(models.Model):
compute="_compute_auto_renew",
store=True,
readonly=False,
precompute=True,
)
auto_renew_interval = fields.Integer(
default=1,
Expand All @@ -58,6 +63,7 @@ class SaleOrderLine(models.Model):
store=True,
readonly=False,
help="Renew every (Days/Week/Month/Year)",
precompute=True,
)
auto_renew_rule_type = fields.Selection(
[
Expand All @@ -72,6 +78,7 @@ class SaleOrderLine(models.Model):
readonly=False,
string="Renewal type",
help="Specify Interval for automatic renewal.",
precompute=True,
)
contract_start_date_method = fields.Selection(
related="product_id.contract_start_date_method"
Expand Down

0 comments on commit 4f6bd60

Please sign in to comment.