From 5cf77ecb5af36662b13bbf1d55304b0a711ee10e Mon Sep 17 00:00:00 2001 From: "pankita shah (Open ERP)" Date: Thu, 18 Oct 2012 18:34:44 +0530 Subject: [PATCH] [IMP] improve action message as per suggection bzr revid: shp@tinyerp.com-20121018130444-bu8iv6kez1xt1js1 --- addons/hr_attendance/hr_attendance.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/hr_attendance/hr_attendance.py b/addons/hr_attendance/hr_attendance.py index baebf28f1ad..38364f478e7 100644 --- a/addons/hr_attendance/hr_attendance.py +++ b/addons/hr_attendance/hr_attendance.py @@ -158,7 +158,10 @@ class hr_employee(osv.osv): if employee.state == 'absent': action = 'sign_in' if not self._action_check(cr, uid, employee.id, action_date, context): - raise osv.except_osv(_('Warning'), _('You are trying to %s for a date that is posterior to the starting date of the project. Please contact the HR Manager to correct attendances.')%(action),) + if action == 'sign_out': + raise osv.except_osv(_('Warning'), _('You are trying to sign out for a date that is posterior to the starting date of the project. Please contact the HR Manager to correct attendances.')) + elif action == 'action': + raise osv.except_osv(_('Warning'), _('You are trying to sign out and switch project for a date that is posterior to the starting date of the current project. Please contact the HR Manager to correct attendances.')) vals = {'action': action, 'employee_id': employee.id} if action_date: