From 9a9720ac14d3508e93339e351ba19de4b3ca2fd6 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 24 Aug 2015 18:05:26 +0200 Subject: [PATCH] [FIX] sale: in a SO line, changing uom qty must change uos qty This is a regression from rev. 1cedcf6abb433beb78675557fabd9ee6e49c504e Not updating the product uos qty on updating the uom qty is wrong, and it has multiple side-effect. The SO line margin not being correctly recomputed when changing the quantity is one of them. opw-647902 --- addons/sale/sale.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 0457abc0fa1..da75b51eba4 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1199,7 +1199,10 @@ class sale_order_line(osv.osv): else: result.update({'price_unit': price}) if context.get('uom_qty_change', False): - return {'value': {'price_unit': price}, 'domain': {}, 'warning': False} + values = {'price_unit': price} + if result.get('product_uos_qty'): + values['product_uos_qty'] = result['product_uos_qty'] + return {'value': values, 'domain': {}, 'warning': False} if warning_msgs: warning = { 'title': _('Configuration Error!'),