"""
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
})[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)
"""
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):