From b7fd6fd9af58eee753828fd8dfd6012e722b5b87 Mon Sep 17 00:00:00 2001 From: amoyaux Date: Tue, 14 Feb 2017 14:35:07 +0100 Subject: [PATCH] [FIX] sale: Traceback product_packaging on SO line When we add a SO line on a sale order with a product packaging, a traceback is raised. The problem comes from a default value and a domain set in the context which reference a product template but since this rev: 796900feb76f7ca5084d6b5f90cb24d5448cc326 the product packagings are linked to product_product and not product_template anymore. So we used the product_id field instead of product_tmpl_id. And remove product_tmpl_id from the sale_order_line model which is not used anymore --- addons/sale_stock/models/sale_order.py | 1 - addons/sale_stock/views/sale_order_views.xml | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index 3e5a757ef6e..46a586774c2 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -89,7 +89,6 @@ class SaleOrderLine(models.Model): product_packaging = fields.Many2one('product.packaging', string='Packaging', default=False) route_id = fields.Many2one('stock.location.route', string='Route', domain=[('sale_selectable', '=', True)]) - product_tmpl_id = fields.Many2one('product.template', related='product_id.product_tmpl_id', string='Product Template', readonly=True) @api.depends('order_id.state') def _compute_invoice_status(self): diff --git a/addons/sale_stock/views/sale_order_views.xml b/addons/sale_stock/views/sale_order_views.xml index e686523e646..7e6e4192851 100644 --- a/addons/sale_stock/views/sale_order_views.xml +++ b/addons/sale_stock/views/sale_order_views.xml @@ -24,8 +24,7 @@ - - +