Skip to content
Snippets Groups Projects
Commit 954cabc7 authored by daniquilez's avatar daniquilez
Browse files

[IMP] :sparkles: Propagate sale description from product to contract template line

parent b428cab3
Branches dev
No related tags found
2 merge requests!504Release 2025-03-11,!502Refactor module energy communities service invoicing
......@@ -30,3 +30,16 @@ class ProductTemplate(models.Model):
ctemplates = self.env["contract.template"].search([])
for ctemplate in ctemplates:
ctemplate.compute_is_pack()
@api.constrains("description_sale")
def compute_contract_template_line_name(self):
for record in self:
ctemplatelines = self.env["contract.template.line"].search(
[("product_id", "=", record.product_variant_id.id)]
)
for ctemplateline in ctemplatelines:
ctemplateline.write(
{
"name": ctemplateline.product_id.get_product_multiline_description_sale()
}
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment