changeset 04bbe9c43b2a in modules/product_kit:6.2
details:
https://hg.tryton.org/modules/product_kit?cmd=changeset&node=04bbe9c43b2a
description:
Use planned shipping and delivery date for move planned date
issue11185
review364701002
(grafted from a9bc9a58f16c01e591636107bb934d9d31409c64)
diffstat:
purchase.py | 12 +-----------
sale.py | 12 +-----------
2 files changed, 2 insertions(+), 22 deletions(-)
diffs (58 lines):
diff -r 0e7a211897bd -r 04bbe9c43b2a purchase.py
--- a/purchase.py Mon Nov 01 17:30:33 2021 +0100
+++ b/purchase.py Sun Jan 30 13:14:44 2022 +0100
@@ -72,7 +72,6 @@
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
@@ -103,16 +102,7 @@
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
diff -r 0e7a211897bd -r 04bbe9c43b2a sale.py
--- a/sale.py Mon Nov 01 17:30:33 2021 +0100
+++ b/sale.py Sun Jan 30 13:14:44 2022 +0100
@@ -74,7 +74,6 @@
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
@@ -104,16 +103,7 @@
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