Skip to Content
Menu
This question has been flagged
2 Replies
1987 Views

I have a problem, when I use this formula to calculate the days not worked result = - (contract.wage / 31) * worked_days.Unpaid.number_of_days the result gives me zero. can someone help me solve it?

Avatar
Discard
Best Answer

Hi,

I have applied the steps in the below article in my odoo 11 ce and it's working:

https://www.cybrosys.com/blog/hr-unpaid-leaves-payroll-management-in-odoo-10  

You have to setup all information in the contract, the Working schedules, type, duration, basic wage, scheduled pay and salary structure.  and create UNPAID rule as mentioned in the article and add it to the salary structure.

The below is the python code which I used:

try:
result =-(contract.wage/31) * worked_days.Unpaid.number_of_days
except:
result = 0

Avatar
Discard