[FIX] sale: in a SO line, changing uom qty must change uos qty

This is a oversight of the forward port
af07b2a075
from 8.0

The revision in 8.0 is
9a9720ac14

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-647810
This commit is contained in:
Denis Ledoux
2015-08-27 11:53:28 +02:00
parent 3d496addf5
commit 136bd72379
+3
View File
@@ -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}