odoomates / odooapps

248 stars 342 forks source link

Payroll with more than 1 Leave rules in Odoo13 #16

Open sarav21 opened 4 years ago

sarav21 commented 4 years ago

I have 2 rules for leaves in my structure, it say:

Error: om_hr_payroll/models/hr_payslip.py", line 173, in get_worked_day_lines 'name': holiday.holiday_statusid.name or ('Global Leaves'), File "/odoo/odoo-server/odoo/fields.py", line 979, in get record.ensure_one() File "/odoo/odoo-server/odoo/models.py", line 4984, in ensure_one raise ValueError("Expected singleton: %s" % self) ValueError: Expected singleton: hr.leave.type(5, 4)

sarav21 commented 4 years ago

It works with me after add this line after line no 170:

holidays = leave.holiday_id for holiday in holidays: