[FIX] When purchase, do not overwrite price
This commit is contained in:
parent
82c5aa6774
commit
1512534320
|
@ -91,7 +91,7 @@ class stock_move(osv.osv):
|
|||
"""
|
||||
Attribute price to move, important in inter-company moves or receipts with only one partner
|
||||
"""
|
||||
if move.location_id.usage != 'internal' and move.location_dest_id.usage == 'internal' and not move.price_unit:
|
||||
if not move.purchase_line_id and move.location_id.usage != 'internal' and move.location_dest_id.usage == 'internal' and not move.price_unit:
|
||||
partner = move.partner_id or (move.picking_id and move.picking_id.partner_id)
|
||||
price = False
|
||||
# If partner given, search price in its purchase pricelist
|
||||
|
@ -105,7 +105,7 @@ class stock_move(osv.osv):
|
|||
})[pricelist]
|
||||
if price:
|
||||
self.write(cr, uid, [move.id], {'price_unit': price}, context=context)
|
||||
return True
|
||||
return True
|
||||
super(stock_move, self).attribute_price(cr, uid, move, context=context)
|
||||
|
||||
|
||||
|
|
|
@ -2018,8 +2018,9 @@ class stock_move(osv.osv):
|
|||
"""
|
||||
Attribute price to move, important in inter-company moves or receipts with only one partner
|
||||
"""
|
||||
price = move.product_id.standard_price
|
||||
self.write(cr, uid, [move.id], {'price_unit': price})
|
||||
if not move.price_unit:
|
||||
price = move.product_id.standard_price
|
||||
self.write(cr, uid, [move.id], {'price_unit': price})
|
||||
|
||||
|
||||
def action_confirm(self, cr, uid, ids, context=None):
|
||||
|
|
Loading…
Reference in New Issue