Use product cost_price only if not already in vals
in create method of stock.move
This commit is contained in:
1 parent
81d9bee8d7
commit
05d417bcd7
1 file changed
+5
-4
@@ -459,10 +459,11 @@ class Move(ModelSQL, ModelView):
|
||||
cursor, user, vals['product'], -vals['quantity'],
|
||||
vals['uom'], vals['unit_price'], vals['currency'],
|
||||
vals['company'], context=context)
|
||||
#Re-read the product because cost_price has been updated
|
||||
product = product_obj.browse(cursor, user, vals['product'],
|
||||
context=context)
|
||||
vals['cost_price'] = product.cost_price
|
||||
if not vals.get('cost_price'):
|
||||
product = product_obj.browse(cursor, user, vals['product'],
|
||||
context=context)
|
||||
vals['cost_price'] = product.cost_price
|
||||
|
||||
elif vals.get('state') == 'assigned':
|
||||
if not vals.get('effective_date'):
|
||||
vals['effective_date'] = datetime.date.today()
|
||||
|
||||
Reference in new issue
Block a user