diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py index 0875ff88fab..1e26aaa65eb 100644 --- a/addons/purchase/stock.py +++ b/addons/purchase/stock.py @@ -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) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 56d525ab158..f033b4d5e6a 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -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):