Worked day calculation in Payroll

Bug #1050780 reported by Sean
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP R&D Addons Team 3

Bug Description

We allow the employees create their leave request in hours by inputting the "Number of Days" field with a float number, 0.5 for example. But in hr_payroll module, it will be calculated as one full day which is not correct.

I think the problem is in the get_worked_day_lines() method of hr_payslip class:

                        #if he was on leave, fill the leaves dict
                        if leave_type in leaves:
                            leaves[leave_type]['number_of_days'] += 1.0
                            leaves[leave_type]['number_of_hours'] += working_hours_on_day
                        else:
                            leaves[leave_type] = {
                                'name': leave_type,
                                'sequence': 5,
                                'code': leave_type,
                                'number_of_days': 1.0,
                                'number_of_hours': working_hours_on_day,
                                'contract_id': contract.id,
                            }

The number_of_days and number_of_hours should be the actual value in the leave request.

Tags: hr payroll
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Sean,

Yes You are right, If you select the same day on leave request based on hours then It's calculate the 1 day. Also the Day field is float field, So you can easily edit it i.e 0.5.

Your suggestion is calculate this to automatically which is quite fine and I agree with you. But it's quite complex to manage it that's why currently I am considering as a good improvement and feature request.

That's why I am setting this as a "Wishlist'.

Thanks for the reporting!

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Eduardo Vizcaino Granados (evigra) wrote :

see the following link
the error is elsewhere

view in https://bugs.launchpad.net/openobject-addons/+bug/1089525

tags: added: hr payroll
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.