[FIX] timesheet_sheet should not crash anymmore when tests are performed at 23:59

bzr revid: fp@tinyerp.com-20120917081451-ugk1qi0le22kn44n
This commit is contained in:
Fabien Pinckaers 2012-09-17 10:14:51 +02:00
parent a0f23eb60b
commit fabf4971aa
2 changed files with 16 additions and 12 deletions

View File

@ -55,7 +55,7 @@ class hr_attendance(osv.osv):
'name': fields.datetime('Date', required=True, select=1),
'action': fields.selection([('sign_in', 'Sign In'), ('sign_out', 'Sign Out'), ('action','Action')], 'Action', required=True),
'action_desc': fields.many2one("hr.action.reason", "Action Reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'),
'employee_id': fields.many2one('hr.employee', "Employee's Name", required=True, select=True),
'employee_id': fields.many2one('hr.employee', "Employee", required=True, select=True),
'day': fields.function(_day_compute, type='char', string='Day', store=True, select=1, size=32),
}
_defaults = {

View File

@ -13,7 +13,7 @@
product_id: product.product_product_consultant
journal_id: hr_timesheet.analytic_journal
-
I create my current timesheet for employee "Quentin Paolinon".
I create a timesheet for employee "Quentin Paolinon".
-
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}:
date_current: !eval time.strftime('%Y-%m-%d')
@ -23,13 +23,17 @@
user_id: base.user_demo
employee_id: 'hr.employee_qdp'
-
Now, at the time of login, I create Attendances and perform "Sign In" action.
Quentin "Sign In" at around 9am.
-
!python {model: hr_timesheet_sheet.sheet}: |
self.attendance_action_change(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {})
task_work = self.search(cr, uid, [("name","=","Quentin Paolinon")],context)[0]
task_ids = self.browse(cr, uid, task_work, context)
assert task_ids.state == "draft", "I State In Timesheet"
!record {model: hr.attendance, id: hr_attendance_1}:
action: sign_in
employee_id: 'hr.employee_qdp'
name: !eval datetime.now().strftime('%Y-%m-%d 09:%M:%S')
-
I test that Quentin in signed in
-
!assert {model: hr.employee, id: hr.employee_qdp}:
- state == 'present'
-
I want to check attendance and work of yesterday. I click on <- button.
-
@ -57,10 +61,10 @@
-
At the time of logout, I create attendance and perform "Sign Out".
-
!record {model: hr.attendance, id: hr_attendance_1}:
!record {model: hr.attendance, id: hr_attendance_2}:
action: sign_out
employee_id: 'hr.employee_qdp'
name: !eval (datetime.now() + timedelta(minutes=1)).strftime('%Y-%m-%d %H:%M:%S')
name: !eval datetime.now().strftime('%Y-%m-%d 17:30:00')
-
I create Timesheet Entry for time spend on today work.
-
@ -103,10 +107,10 @@
general_account_id: account.a_expense
journal_id: hr_timesheet.analytic_journal
-
I set an allowed difference of 25 hours
I set an allowed difference of 1 hour
-
!record {model: res.company, id: base.main_company}:
timesheet_max_difference: 25.00
timesheet_max_difference: 1.00
-
I tried again to confirm the timesheet after modification.
-