[IMP] mrp: time tracking consider now as end date

When changing the duration on a time-tracking entry on a workorder, set
the end time to now and calculate the start time by detracting the
duration, instead of the other way around.

Task: 3456827 (nr 35)
Part-of: odoo/odoo#137535
This commit is contained in:
Pieter Claeys (clpi)
2023-10-19 14:47:23 +00:00
committed by svs-odoo
parent adb0476e5f
commit 2f56c8c0bb
+1 -1
View File
@@ -418,7 +418,7 @@ class MrpWorkcenterProductivity(models.Model):
@api.onchange('duration')
def _duration_changed(self):
self.date_end = self.date_start + timedelta(minutes=self.duration)
self.date_start = self.date_end - timedelta(minutes=self.duration)
self._loss_type_change()
@api.onchange('date_start')