Skip to content
Snippets Groups Projects
Commit a60b90c5 authored by William Henrotin's avatar William Henrotin Committed by Arnold Moyaux
Browse files

[FIX] stock: cast string as date


Writing for the web interface on the scheduled date of a stock move
will failed as the date is send to the python server as a string. Then,
a duration in datetime format is added. This failed as operation on string
and datetime is forbidden.
This commit cast the string date into a datetime object before applying
date logic.

closes odoo/odoo#42287

X-original-commit: 8f122297
Signed-off-by: default avatarSimon Lejeune (sle) <sle@openerp.com>
parent e288af81
No related branches found
No related tags found
No related merge requests found
......@@ -464,7 +464,7 @@ class StockMove(models.Model):
elif vals.get('state', '') == 'done' and vals.get('date'):
propagated_date_field = 'date'
if propagated_date_field:
new_date = vals.get(propagated_date_field)
new_date = fields.Datetime.to_datetime(vals.get(propagated_date_field))
for move in self:
move_dest_ids = move.move_dest_ids.filtered(lambda m: m.state not in ('done', 'cancel'))
if not move_dest_ids:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment