[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
This commit is contained in:
Nicolas Martinelli
2015-12-10 11:37:34 +01:00
parent 6e945de681
commit 35a390daf1
+4 -4
View File
@@ -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}