[FIX] sale: in a SO line, changing uom qty must change uos qty
This is a oversight of the forward portaf07b2a075from 8.0 The revision in 8.0 is9a9720ac14Not 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-647810
This commit is contained in:
@@ -1165,7 +1165,10 @@ class sale_order_line(osv.osv):
|
||||
if update_tax:
|
||||
price = self.pool['account.tax']._fix_tax_included_price(cr, uid, price, product_obj.taxes_id, 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
|
||||
result.update({'price_unit': price})
|
||||
return {'value': result, 'domain': domain}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user