Hi,
We have 4 type of Leaves (Annual, Sick, Lieu & Unpaid) and all of those are paid except the Unpaid leave. the issue is that Odoo normal behaviour is to deduct all leave from the number of working days which should not be the case so I am trying to create a salary rule to solve this;
result = ((contract.wage/26)*0.6)*(worked_days.WORK100.number_of_days+worked_days.Annual2015.number_of_days+worked_days.Lieu.number_of_days)
This works only if the employee has both the Annual2015 and the Lieu but wrong python code will come if none or either of the leave does not exist for that employee. So I am trying to build a salary rule deal with this as following however everything I try return Python error:
if (worked_days.Annual2015.number_of_days and inputs.worked_days.Lieu.number_of_days):
result = (((contract.wage/26)*0.6)*worked_days.WORK100.number_of_days) elif (worked_days.Annual2015.number_of_days is None and worked_days.Lieu.number_of_days > 0): result = ((contract.wage/26)*0.6)*(worked_days.WORK100.number_of_days+worked_days.Lieu.number_of_days) elif (worked_days.Annual2015.number_of_days > 0 and worked_days.Lieu.number_of_days is None): result = ((contract.wage/26)*0.6)*(worked_days.WORK100.number_of_days+worked_days.Annual2015.number_of_days)
I appreciate your help on this.
can you post the error msg ?