[FIX] hr_payroll_timesheet: onchange error by sorting, better to use create_date

This commit is contained in:
Jared Kipe
2022-01-10 16:21:24 -08:00
parent 388a25908e
commit 3f36f96d0f

View File

@@ -48,7 +48,7 @@ class HrPayslip(models.Model):
return work_data return work_data
def _pre_aggregate_timesheet_data(self, work_data, default_workentrytype): def _pre_aggregate_timesheet_data(self, work_data, default_workentrytype):
for ts in self.timesheet_ids.sorted('id'): for ts in self.timesheet_ids.sorted('create_date'):
if ts.unit_amount: if ts.unit_amount:
ts_iso = ts.date.isocalendar() ts_iso = ts.date.isocalendar()
timesheet_type = ts.work_type_id or default_workentrytype timesheet_type = ts.work_type_id or default_workentrytype