From 35a390daf1c8fa7aa0ffe548d0986e8e0a41f4e6 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 10 Dec 2015 10:05:06 +0100 Subject: [PATCH] [FIX] sale: change qty updates weight The method `product_id_change` has become quite a mess with time as it gathers a lot of onchanges. Therefore, previous commits were made in order to prevent unwanted side effects, such as af07b2a0, 1cedcf6a and 136bd723. This revision fixes the weight which was lost with commit af07b2a0. opw-658712 --- addons/sale/sale.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 49652efb234..7e1c28577a4 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1173,10 +1173,10 @@ class sale_order_line(osv.osv): price = Product.price_get(cr, uid, [product], ptype='list_price', context=ctx_product)[product] or False price = self.pool['account.tax']._fix_tax_included_price(cr, uid, price, taxes, result['tax_id']) if context.get('uom_qty_change', False): - product_uos_qty = result.get('product_uos_qty') - result, domain = {}, {} - if product_uos_qty: - result['product_uos_qty'] = product_uos_qty + # Remove unnecessary changes + domain = {} + for key in ["name", "product_uom", "product_uos", "tax_id"]: + result.pop(key, None) result.update({'price_unit': price}) return {'value': result, 'domain': domain}