From 88497979e03b5f6f0f6dd5ab672f58082ba6db3b Mon Sep 17 00:00:00 2001 From: sbejaoui Date: Tue, 26 Nov 2019 09:54:55 +0100 Subject: [PATCH] [12.0][FIX] - Run onchange contract_type when changing the contract template Fix this use-case: If the contract journal is not set on the contract template the contract is created without a journal when confirming the sale order --- product_contract/models/sale_order.py | 1 + 1 file changed, 1 insertion(+) diff --git a/product_contract/models/sale_order.py b/product_contract/models/sale_order.py index a7f408c41..1a277a963 100644 --- a/product_contract/models/sale_order.py +++ b/product_contract/models/sale_order.py @@ -82,6 +82,7 @@ class SaleOrder(models.Model): ) contracts |= contract contract._onchange_contract_template_id() + contract._onchange_contract_type() order_lines.create_contract_line(contract) order_lines.write({'contract_id': contract.id}) for line in line_to_update_contract: