[MERGE] [FIX] hr_timesheet_sheet: set default date to now when computing date in user's timezone, courtesy of Yannick Vaucher (Camptocamp)
eg: the sign-in/sign-out button on the employee do not provide date yet (value defined in _defaults) and it would broke the computation bzr revid: mat@openerp.com-20140430121458-9h8c8j7fw823qf27
This commit is contained in:
commit
431ef5c552
|
@ -407,6 +407,9 @@ class hr_attendance(osv.osv):
|
|||
employee = employee_obj.browse(cr, uid, employee_id, context=context)
|
||||
tz = employee.user_id.partner_id.tz
|
||||
|
||||
if not date:
|
||||
date = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
|
||||
att_tz = timezone(tz or 'utc')
|
||||
|
||||
attendance_dt = datetime.strptime(date, DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
|
|
Loading…
Reference in New Issue