From c05e36837fc83e99285461df929b75498fff02d1 Mon Sep 17 00:00:00 2001 From: sbejaoui Date: Tue, 17 Mar 2020 17:56:50 +0100 Subject: [PATCH] [12.0][FIX] - fix contract creation group by contract template --- product_contract/models/sale_order.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/product_contract/models/sale_order.py b/product_contract/models/sale_order.py index 57467736c..98b4b948d 100644 --- a/product_contract/models/sale_order.py +++ b/product_contract/models/sale_order.py @@ -83,6 +83,7 @@ class SaleOrder(models.Model): 'sale_order_line_id' ) ) + contract_templates = self.env["contract.template"] for order_line in line_to_create_contract: contract_template = order_line.product_id.with_context( force_company=rec.company_id.id @@ -95,6 +96,8 @@ class SaleOrder(models.Model): rec.company_id.name ) ) + contract_templates |= contract_template + for contract_template in contract_templates: order_lines = line_to_create_contract.filtered( lambda r, template=contract_template: r.product_id.with_context(