Use planned shipping and delivery date for move planned date

issue11185
review364701002
(grafted from a9bc9a58f16c01e591636107bb934d9d31409c64)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2022-01-30 13:14:44 +01:00
1 parent 4e69f95429
commit 77b449fd00
2 files changed
+2 -22

No files matched your search

+1 -11
View File
@@ -67,7 +67,6 @@ class LineComponent(
from trytond.modules.purchase.exceptions import PartyLocationError
pool = Pool()
Move = pool.get('stock.move')
Date = pool.get('ir.date')
if (self.quantity >= 0) != (move_type == 'in'):
return
@@ -98,16 +97,7 @@ class LineComponent(
move.unit_price = round_price(
self.line.unit_price * self.price_ratio)
move.currency = self.line.purchase.currency
if self.moves:
# backorder can not be planned but shipping date could be used
# if set in the future
if (self.line.delivery_date
and self.line.delivery_date > Date.today()):
move.planned_date = self.line.shipping_date
else:
move.planned_date = None
else:
move.planned_date = self.line.delivery_date
move.planned_date = self.line.planned_delivery_date
move.origin = self
return move
+1 -11
View File
@@ -68,7 +68,6 @@ class LineComponent(
from trytond.modules.sale.exceptions import PartyLocationError
pool = Pool()
Move = pool.get('stock.move')
Date = pool.get('ir.date')
if (shipment_type == 'out') != (self.quantity >= 0):
return
@@ -98,16 +97,7 @@ class LineComponent(
move.unit_price = round_price(
self.line.unit_price * self.price_ratio)
move.currency = self.line.sale.currency
if self.moves:
# backorder can not be planned but shipping date could be used
# if set in the future
today = Date.today()
if self.line.shipping_date and self.line.shipping_date > today:
move.planned_date = self.line.shipping_date
else:
move.planned_date = today
else:
move.planned_date = self.line.shipping_date
move.planned_date = self.line.planned_shipping_date
move.origin = self
return move