[FIX] hr_payroll_timesheet: repeated onchange in a single change will duplicate timesheet in a set until saved

This commit is contained in:
Jared Kipe
2020-07-16 13:27:35 -07:00
parent ae11a0e595
commit e91aff862b

View File

@@ -33,7 +33,7 @@ class HrPayslip(models.Model):
timesheet_to_keep = self.timesheet_ids.filtered(lambda ts: ts.employee_id == self.employee_id
and ts.date <= self.date_to)
timesheet_to_keep += self.env['account.analytic.line'].search([
timesheet_to_keep |= self.env['account.analytic.line'].search([
('employee_id', '=', self.employee_id.id),
('date', '<=', self.date_to),
('payslip_id', '=', False),