[FIX] hr_payroll_attendance: repeated onchange in a single change will duplicate attendances in a set until saved

This commit is contained in:
Jared Kipe
2020-07-16 13:26:21 -07:00
parent 799880ebcf
commit 06026ee9f0

View File

@@ -33,7 +33,7 @@ class HrPayslip(models.Model):
attendance_to_keep = self.attendance_ids.filtered(lambda a: a.employee_id == self.employee_id
and a.check_out.date() <= self.date_to)
attendance_to_keep += self.env['hr.attendance'].search([
attendance_to_keep |= self.env['hr.attendance'].search([
('employee_id', '=', self.employee_id.id),
('check_out', '<=', self.date_to),
('payslip_id', '=', False),