mirror of
https://github.com/NaN-tic/trytond-stock_external_reception.git
synced 2023-12-14 03:43:03 +01:00
Set unit_price if unit_price is required in move
This commit is contained in:
parent
a40667f254
commit
4fcab8bb17
1 changed files with 3 additions and 1 deletions
|
@ -164,6 +164,9 @@ class ExternalReception(Workflow, ModelSQL, ModelView):
|
||||||
move = line._get_move()
|
move = line._get_move()
|
||||||
move.to_location = shipment.to_location
|
move.to_location = shipment.to_location
|
||||||
move.from_location = shipment.from_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)
|
moves.append(move._save_values)
|
||||||
shipment.moves = moves
|
shipment.moves = moves
|
||||||
vals = shipment._save_values
|
vals = shipment._save_values
|
||||||
|
@ -213,7 +216,6 @@ class ExternalReception(Workflow, ModelSQL, ModelView):
|
||||||
return super(ExternalReception, cls).copy(receptions, default=default)
|
return super(ExternalReception, cls).copy(receptions, default=default)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ExternalReceptionLine(ModelSQL, ModelView):
|
class ExternalReceptionLine(ModelSQL, ModelView):
|
||||||
"External Reception Line"
|
"External Reception Line"
|
||||||
__name__ = 'stock.external.reception.line'
|
__name__ = 'stock.external.reception.line'
|
||||||
|
|
Loading…
Reference in a new issue