diff --git a/addons/hr_attendance/hr_attendance.py b/addons/hr_attendance/hr_attendance.py index 2161f0886b1..8994f96de4a 100644 --- a/addons/hr_attendance/hr_attendance.py +++ b/addons/hr_attendance/hr_attendance.py @@ -114,7 +114,11 @@ class hr_employee(osv.osv): def attendance_action_change(self, cr, uid, ids, type='action', context={}, dt=False, *args): id = False warning_sign = 'sign' - + + #Special case when button calls this method :type=context + if isinstance(type,dict): + type = type.get('type','action') + if type == 'sign_in': warning_sign = "Sign In" elif type == 'sign_out': @@ -125,7 +129,7 @@ class hr_employee(osv.osv): raise osv.except_osv(_('Warning'), _('You tried to %s with a date anterior to another event !\nTry to contact the administrator to correct attendances.')%(warning_sign,)) res = {'action' : type, 'employee_id' : emp['id']} - + if dt: res['name'] = dt diff --git a/addons/hr_attendance/hr_attendance_view.xml b/addons/hr_attendance/hr_attendance_view.xml index 2511d76b1f5..6bfedddd3b5 100644 --- a/addons/hr_attendance/hr_attendance_view.xml +++ b/addons/hr_attendance/hr_attendance_view.xml @@ -99,8 +99,8 @@ -