From 6233c37f1448c8e004264505ecaa282b705df7be Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Fri, 22 Mar 2019 08:53:57 +0000 Subject: [PATCH] [FIX] sale_stock: hide redundant incoterms_id field The field incoterms_id is made redundant by the field incoterm_id introduced in b5bb5bd421. As such, it has been removed in master at: 569a498d360 We make this field invisible, and synchronize the invoice incoterm_id with the sale order incoterm. opw 1935573 closes odoo/odoo#32039 Signed-off-by: Nans Lefebvre (len) --- addons/sale_stock/models/sale_order.py | 2 ++ addons/sale_stock/views/account_invoice_views.xml | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index 4c2ad3262d3..41cd9b7ccc6 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -128,6 +128,8 @@ class SaleOrder(models.Model): def _prepare_invoice(self): invoice_vals = super(SaleOrder, self)._prepare_invoice() invoice_vals['incoterms_id'] = self.incoterm.id or False + if self.incoterm.id: + invoice_vals['incoterm_id'] = self.incoterm.id return invoice_vals @api.model diff --git a/addons/sale_stock/views/account_invoice_views.xml b/addons/sale_stock/views/account_invoice_views.xml index ed8e07b1a54..e7d2dc1daa6 100644 --- a/addons/sale_stock/views/account_invoice_views.xml +++ b/addons/sale_stock/views/account_invoice_views.xml @@ -7,7 +7,7 @@ - + @@ -16,9 +16,9 @@