Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
7 Odpowiedzi
3823 Widoki

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? 

Awatar
Odrzuć
Najlepsza odpowiedź
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
Awatar
Odrzuć
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 Najlepsza odpowiedź

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

Any help?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lis 23
2390
0
wrz 18
3374
0
paź 17
10104
2
sie 17
7502
2
lip 24
10378