[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
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user