Skip to Content
Menú
This question has been flagged
7 Respostes
3805 Vistes

Hello,

When I take leave request for 1 day. it show 1 day properly on leave details but on payslip number of days display 1.13.

working time is 9 hours. also checking hr.holidays in postgresql number of days is 1. but don't understand on payslip how it take 1.13.I am using odoo v10. after taking working time is 8 hours there is no issue. why this happen? 

hr_payroll.py

leaves = [value for key, value in leaves.items()]
for data in [attendances] + leaves:
    data['number_of_days'] = uom_hour._compute_quantity(data['number_of_hours'], uom_day)\
        if uom_day and uom_hour\
        else data['number_of_hours'] / 8.0

    res.append(data)

also explain bold lines.



any help? 

Avatar
Descartar
Best Answer
Hello,

Please set your timezone in your currently logged in user as per your region and add the leave and count the payroll again to resolve this issue.

data['number_of_days'] = uom_hour._compute_quantity(data['number_of_hours'], uom_day)\
        if uom_day and uom_hour\
        else data['number_of_hours'] / 8.0

This is a condition to convert the hours to days. Due to factor ration in hours is 8, it will affect the hours over 8 hrs.

This will execute as :

if uom_day and uom_hour:
    data['number_of_days'] = uom_hour._compute_quantity(data['number_of_hours'], uom_day)
else:
    data['number_of_days'] =  data['number_of_hours'] / 8.0

So if uom_hour and uom_day, then it will convert the hours to days,
otherwise it will directly divide the hours by 8.

Hope it will work for you,
Thanks
Avatar
Descartar
Autor

For 8 hours working time there is no issue. if I take 9 hours or 10 hours working time then data['number_of_days'] = 1.13 or data['number_of_days'] = 1.25 which means data['numbers_of_hours'] is divided by 8 not 9 or 10. then should I change code or any other solution.

Autor

please reply me its urgent.

Autor

After setting timezone in currently logged in user as per my region still not working..

Ok, Please check the Rounding Precision for Day(s) and Hour(s) Unit of Measure, Hope you have not added any customisation for Unit of Measure. If it's urgent and you want to change the code, then you can directly divide the number of days by your working time.

Autor Best Answer

Thanks @Malay B Khamar for your answer and time. your solution useful for me. I understand factor ratio is 8 hence I got data['number_of_days'] = 1.13 or data['number_of_days'] = 1.25 for working time 9 or 10. on changing factor ratio 9 or 10 work for me.

Avatar
Descartar
Best Answer

Hey how did you get this working?  When i change hr_payroll.py to divide by 9.0 nothing happens?

Any help?

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de nov. 23
2324
0
de set. 18
3311
0
d’oct. 17
10046
2
d’ag. 17
7477
2
de jul. 24
10346