[FIX] mrp: make MO date_planned_start default=now again

In PR: #74540 the MO.date_planned_start default was updated to
round up to the next hour. It was later decided this would be too
confusing so this commit reverts it back to the original default of now
(i.e. without any hour rounding)

closes odoo/odoo#77956

X-original-commit: 44c66cce8e545afd7b38c7fc81425fa69023798e
Related: odoo/enterprise#21506
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
This commit is contained in:
Tiffany Chang (tic)
2021-10-06 13:51:03 +00:00
parent b92ca15aca
commit 470acba7a6
+1 -1
View File
@@ -65,7 +65,7 @@ class MrpProduction(models.Model):
def _get_default_date_planned_start(self):
if self.env.context.get('default_date_deadline'):
return fields.Datetime.to_datetime(self.env.context.get('default_date_deadline'))
return fields.Datetime.now().replace(minute=0, second=0, microsecond=0) + datetime.timedelta(hours=1)
return datetime.datetime.now()
@api.model
def _get_default_is_locked(self):