تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
7 الردود
3973 أدوات العرض

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? 

الصورة الرمزية
إهمال
أفضل إجابة
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
الصورة الرمزية
إهمال
الكاتب

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.

الكاتب

please reply me its urgent.

الكاتب

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.

الكاتب أفضل إجابة

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.

الصورة الرمزية
إهمال
أفضل إجابة

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

Any help?

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
نوفمبر 23
2646
0
سبتمبر 18
3642
0
أكتوبر 17
10326
2
أغسطس 17
7727
2
يوليو 24
10620