← Back to team overview

openerp-india team mailing list archive

[Bug 1050780] [NEW] Worked day calculation in Payroll

 

Public bug reported:

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.

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1050780

Title:
  Worked day calculation in Payroll

Status in OpenERP Addons (modules):
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1050780/+subscriptions


Follow ups

References