hr_schedule Exception Rules not accurate for attendance and schedule on different time zone
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Human Resources - Next Generation for OpenERP |
New
|
Undecided
|
Unassigned |
Bug Description
OpenERP server installed on Ubuntu with PHT locale (GMT+8)
All time are in PHT (GMT +8)
Prerequisite module: hr_payroll_
Steps to produce:
1st problem:
1. Create an Employee and assign a contract then confirm it. (Do not use the default OpenERP demo employee since it cause an error that has something to do with assigning job_id. You need to create a new one)
2. Create a schedule for the employee on April 1, 2014 (any first day of the month will do) from 09:30 to 17:50 then save it. (OpenERP records this as 2014-04-01 01:30 and 2014-04-01 09:50 )
3. Create a payroll period for April 1 to 30 2014 with the type Monthly and Timezone Asia/Manila (or any GMT +8 w/o DST)
4. OpenERP save the payroll period with start date = 2014-03-31 16:00:00 and end date 2014-04-30 15:59:59. (Why? Because OpenERP 7.0 server always saves the datetime value in UTC)
5. Create a Sign In and Sign Out attendance record at the same time of the schedule
6. Go to End of Pay Period menu and click the End of Pay Period Wizard.
7. On Step 1. Check Attendance Records click the Re-check button. No matter what you do, you will always have a misattendance because the system starts at 2014-03-31 with a stripped hour.
The function _do_recalc_alerts on hr_payroll_
Regardless whether the compute_
2nd problem:
The function compute_
Attached is the original hr_schedule and hr_payroll_period module (dependency module not included) and the fix I've created