Set empty currency and unit price on stock move when not required
Closes #14023 (grafted from 6090f9c621e782cd47eb0537dee972c2f1fa8fe6) --HG-- branch : 7.0
This commit is contained in:
@@ -114,6 +114,9 @@ class LineComponent(
|
||||
move.unit_price = round_price(
|
||||
self.line.unit_price * self.price_ratio)
|
||||
move.currency = self.line.purchase.currency
|
||||
else:
|
||||
move.unit_price = None
|
||||
move.currency = None
|
||||
move.planned_date = self.line.planned_delivery_date
|
||||
move.origin = self
|
||||
move.origin_planned_date = move.planned_date
|
||||
|
||||
@@ -111,6 +111,9 @@ class LineComponent(
|
||||
move.unit_price = round_price(
|
||||
self.line.unit_price * self.price_ratio)
|
||||
move.currency = self.line.sale.currency
|
||||
else:
|
||||
move.unit_price = None
|
||||
move.currency = None
|
||||
move.planned_date = self.line.planned_shipping_date
|
||||
move.origin = self
|
||||
move.origin_planned_date = move.planned_date
|
||||
|
||||
@@ -1840,6 +1840,9 @@ class Line(sequence_ordered(), ModelSQL, ModelView):
|
||||
if move.on_change_with_unit_price_required():
|
||||
move.unit_price = self.unit_price
|
||||
move.currency = self.purchase.currency
|
||||
else:
|
||||
move.unit_price = None
|
||||
move.currency = None
|
||||
move.planned_date = self.planned_delivery_date
|
||||
move.invoice_lines = self._get_move_invoice_lines(move_type)
|
||||
move.origin = self
|
||||
|
||||
@@ -1869,6 +1869,9 @@ class SaleLine(TaxableMixin, sequence_ordered(), ModelSQL, ModelView):
|
||||
if move.on_change_with_unit_price_required():
|
||||
move.unit_price = self.unit_price
|
||||
move.currency = self.sale.currency
|
||||
else:
|
||||
move.unit_price = None
|
||||
move.currency = None
|
||||
move.planned_date = self.planned_shipping_date
|
||||
move.invoice_lines = self._get_move_invoice_lines(shipment_type)
|
||||
move.origin = self
|
||||
|
||||
@@ -426,6 +426,9 @@ class ShipmentDrop(
|
||||
else:
|
||||
move.unit_price = 0
|
||||
move.currency = self.company.currency
|
||||
else:
|
||||
move.unit_price = None
|
||||
move.currency = None
|
||||
return move
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -1518,6 +1518,9 @@ class ShipmentOut(
|
||||
if inventory_move.on_change_with_unit_price_required():
|
||||
inventory_move.unit_price = move.unit_price
|
||||
inventory_move.currency = move.currency
|
||||
else:
|
||||
inventory_move.unit_price = None
|
||||
inventory_move.currency = None
|
||||
return inventory_move
|
||||
|
||||
@classmethod
|
||||
@@ -1600,6 +1603,9 @@ class ShipmentOut(
|
||||
else:
|
||||
move.unit_price = 0
|
||||
move.currency = self.company.currency
|
||||
else:
|
||||
move.unit_price = None
|
||||
move.currency = None
|
||||
return move
|
||||
|
||||
@classmethod
|
||||
@@ -2682,6 +2688,9 @@ class ShipmentInternal(
|
||||
else:
|
||||
move.unit_price = 0
|
||||
move.currency = self.company.currency
|
||||
else:
|
||||
move.unit_price = None
|
||||
move.currency = None
|
||||
return move
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user