From 70ddff760ff23e960028dbc2cacc630da5b185fc Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Thu, 21 Jun 2018 13:52:47 +0200 Subject: [PATCH] [FIX] stock: when creating a procurement from a stock move, pass the date_expected as date Before, when we created a picking manually with MTO+buy products, put a scheduled date in the future and did "mark as todo", the date on the po was related to now instead of that schedule date. The scheduled date of the picking was passed to the date_expected of the move, but not to the date of the move, which was passed to the date_planned of the created procurement. By passing the date_expected instead of the date of the stock_move to the date_planned of the procurement, the po will have dates in function of the scheduled date of the picking. Courtesy of chienandalu. Closes #25223 --- addons/stock/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index adf4dd2c410..352392ccb7d 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -532,7 +532,7 @@ class StockMove(models.Model): 'name': self.rule_id and self.rule_id.name or "/", 'origin': origin, 'company_id': self.company_id.id, - 'date_planned': self.date, + 'date_planned': self.date_expected, 'product_id': self.product_id.id, 'product_qty': self.product_uom_qty, 'product_uom': self.product_uom.id,