[FIX] sale: Sale Order Line Onchange

Changing the product quantity must not change Product UOM.

opw:644542
This commit is contained in:
Goffin Simon 2015-07-17 08:55:42 +02:00
parent 521c21bf7f
commit 1cedcf6abb
2 changed files with 3 additions and 1 deletions

View File

@ -1188,6 +1188,8 @@ class sale_order_line(osv.osv):
warning_msgs += _("No valid pricelist line found ! :") + warn_msg +"\n\n"
else:
result.update({'price_unit': price})
if context.get('uom_qty_change', False):
return {'value': {'price_unit': price}, 'domain': {}, 'warning': False}
if warning_msgs:
warning = {
'title': _('Configuration Error!'),

View File

@ -129,7 +129,7 @@
<label for="product_uom_qty"/>
<div>
<field
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'uom_qty_change':True}"
name="product_uom_qty" class="oe_inline"
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, False, parent.fiscal_position, True, context)"/>
<field name="product_uom" groups="product.group_uom" class="oe_inline oe_no_button"