Hi all,
I've been going through the forum for this matter for a while now. The only solution provided is to obtain the number of unpaid leaves applied at the Leave module and translated into salary deduction at the Payroll module.
However, my situation is a bit different.
My employee could have forgotten to apply for an Unpaid leave which was supposed to be taken a month before. Once the Unpaid leave is applied, the current python code does not take into account the deduction from last month and this result in the wrong salary provided.
This is the current code I'm using:
Conditions:
result=worked_days.Unpaid and worked_days.Unpaid.number_of_days or False
This code works only if the Unpaid leave is taken in the same month before payroll is closed. I'm using Odoo 12 for Windows.
Please help.
Thanks in advance.