From ba6e7840b67aeaea09bc890f6bec4e9f1efa36d3 Mon Sep 17 00:00:00 2001 From: sbejaoui Date: Fri, 28 Dec 2018 12:36:19 +0100 Subject: [PATCH] [IMP] - update invoice_line vals only if it is not null --- product_contract/models/contract_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_contract/models/contract_line.py b/product_contract/models/contract_line.py index e067929d..0a7a4015 100644 --- a/product_contract/models/contract_line.py +++ b/product_contract/models/contract_line.py @@ -20,6 +20,6 @@ class AccountAnalyticInvoiceLine(models.Model): res = super(AccountAnalyticInvoiceLine, self)._prepare_invoice_line( invoice_id=invoice_id ) - if self.sale_order_line_id: + if self.sale_order_line_id and res: res['sale_line_ids'] = [(6, 0, [self.sale_order_line_id.id])] return res