[FIX] sale: onchange always triggered

The product_id_change was always triggered at the creation of a sale order line.
This is due to the 'type' field that is no longer present in 8.0 and makes the
condition to be always verified.
This commit is contained in:
Martin Trigaux 2015-09-07 10:37:26 +02:00
parent c345d294b1
commit a3a2f374ff
1 changed files with 1 additions and 1 deletions

View File

@ -1080,7 +1080,7 @@ class sale_order_line(osv.osv):
return {'value': value}
def create(self, cr, uid, values, context=None):
if values.get('order_id') and values.get('product_id') and any(f not in values for f in ['name', 'price_unit', 'type', 'product_uom_qty', 'product_uom']):
if values.get('order_id') and values.get('product_id') and any(f not in values for f in ['name', 'price_unit', 'product_uom_qty', 'product_uom']):
order = self.pool['sale.order'].read(cr, uid, values['order_id'], ['pricelist_id', 'partner_id', 'date_order', 'fiscal_position'], context=context)
defaults = self.product_id_change(cr, uid, [], order['pricelist_id'][0], values['product_id'],
qty=float(values.get('product_uom_qty', False)),