When I try to execute multiple slips for the same structure, If any of the rules uses the employee variable it raises an error saying that the variable is a recordset of more than one value. (The variable is holding the value of all the employees which payslip is being calculated).
Does someone know if this is a bug or am I doing something wrong?
This is the code of the rule:
result = result_rules.DDVM['total'] * (employee.holidays_accrued / 30)
The holidays_accrued is a field I added to the hr.employee model.
This is the error:
Wrong python code defined for salary rule Pago por Disfrute Vacacional (PDDVM). Error: : "Expected singleton: hr.employee(2, 3, 4, 5)" while evaluating "\nresult = result_rules.DDVM['total'] * (employee.holidays_accrued / 30)\n
I also checked for the code on the hr_payroll module and both in the compute_rule and in the get_local_dict it is written so it works with each rule. (Which makes me wonder were it's getting the recordset value for the employee that is showing to me in the error).
Any help would be appreciated, thanks!