Merge PR #485 into 12.0

Signed-off-by dreispt
This commit is contained in:
OCA-git-bot
2020-04-06 11:35:59 +00:00
2 changed files with 26 additions and 0 deletions

View File

@@ -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(