From f1918969ee73de516c55b6894138ddae2fb76ce8 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 18 Jan 2010 20:44:10 +0530 Subject: [PATCH] [FIX] Hr_attendance : Button action calling corrected bzr revid: jvo@tinyerp.com-20100118151410-maj5xsc2lsf8f9e0 --- addons/hr_attendance/hr_attendance.py | 8 ++++++-- addons/hr_attendance/hr_attendance_view.xml | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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 @@ -