Set unit_price if unit_price is required in move

This commit is contained in:
Raimon Esteve 2021-04-14 18:51:54 +02:00
parent a40667f254
commit 4fcab8bb17

View file

@ -164,6 +164,9 @@ class ExternalReception(Workflow, ModelSQL, ModelView):
move = line._get_move()
move.to_location = shipment.to_location
move.from_location = shipment.from_location
if move.on_change_with_unit_price_required():
move.unit_price = line.product.cost_price
move.currency = line.reception.company.currency
moves.append(move._save_values)
shipment.moves = moves
vals = shipment._save_values
@ -213,7 +216,6 @@ class ExternalReception(Workflow, ModelSQL, ModelView):
return super(ExternalReception, cls).copy(receptions, default=default)
class ExternalReceptionLine(ModelSQL, ModelView):
"External Reception Line"
__name__ = 'stock.external.reception.line'