[REF] hr_timesheet_sheet : Corrections
authorJay (Open ERP) <jvo@tinyerp.com>
Wed, 11 Aug 2010 15:56:22 +0000 (21:26 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Wed, 11 Aug 2010 15:56:22 +0000 (21:26 +0530)
bzr revid: jvo@tinyerp.com-20100811155622-g8jnvj7pnzi2t7vn

addons/hr_timesheet_sheet/hr_timesheet_sheet.py

index 7b20ed2..8344092 100644 (file)
@@ -136,12 +136,12 @@ class hr_timesheet_sheet(osv.osv):
         return result
 
 
-    def check_employee_attendance_state(self,cr,uid,sheet_id,context=False):
+    def check_employee_attendance_state(self, cr, uid, sheet_id, context=None):
         ids_signin = self.pool.get('hr.attendance').search(cr,uid,[('sheet_id', '=', sheet_id),('action','=','sign_in')])
         ids_signout = self.pool.get('hr.attendance').search(cr,uid,[('sheet_id', '=', sheet_id),('action','=','sign_out')])
 
         if len(ids_signin) != len(ids_signout):
-            raise osv.except_osv('Warning !','The timesheet cannot be validated as it does not contain equal no. of sign ins and sign outs!')
+            raise osv.except_osv(('Warning !'),_('The timesheet cannot be validated as it does not contain equal no. of sign ins and sign outs!'))
         return True
 
     def copy(self, cr, uid, ids, *args, **argv):
@@ -149,7 +149,7 @@ class hr_timesheet_sheet(osv.osv):
 
     def button_confirm(self, cr, uid, ids, context):
         for sheet in self.browse(cr, uid, ids, context):
-            self.check_employee_attendance_state(cr, uid, sheet.id)
+            self.check_employee_attendance_state(cr, uid, sheet.id, context)
             di = sheet.user_id.company_id.timesheet_max_difference
             if (abs(sheet.total_difference) < di) or not di:
                 wf_service = netsvc.LocalService("workflow")