[FIX] mrp: missing cast string to date

Usecase to repdroduce:
- Create a manufactured product with route manufacture and a RR
- Run the scheduler.

Orderpoint will prepare procurement values's date as string. Other
module could possibly also use string as date and a call to from_string
will not break anything if the value is already a date or a datetime.

closes odoo/odoo#38900

X-original-commit: e4c654f8e5e768288226c725a1018ae31e8f5606
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
Arnold Moyaux
2019-10-16 17:17:09 +00:00
committed by fw-bot
parent e5c455f1b6
commit e89c818e5a
+1 -1
View File
@@ -84,7 +84,7 @@ class StockRule(models.Model):
'bom_id': bom.id,
'date_deadline': fields.Datetime.to_string(self._get_date_planned(product_id, company_id, values)),
'date_planned_finished': values['date_planned'],
'date_planned_start': values['date_planned'] - relativedelta(hours=1),
'date_planned_start': fields.Datetime.from_string(values['date_planned']) - relativedelta(hours=1),
'procurement_group_id': False,
'propagate_cancel': self.propagate_cancel,
'propagate_date': self.propagate_date,