+ def sign(self, cr, uid, ids, typ, context=None):
+ self.check_sign(cr, uid, ids, typ, context=context)
+ sign_obj = self.pool.get('hr.sign.in.out')
+ sheet = self.browse(cr, uid, ids, context=context)[0]
+ context['emp_id'] = [sheet.employee_id.id]
+ sign_id = sign_obj.create(cr, uid, {}, context=context)
+ methods = {'sign_in': sign_obj.si_check,
+ 'sign_out': sign_obj.so_check}
+ wizard_result = methods[typ](cr, uid, [sign_id], context=context)
+ if wizard_result.get('type', False) == 'ir.actions.act_window_close':
+ return True # ensure we do not close the main window !
+ wizard_result['nodestroy'] = True # do not destroy the main window !
+ return wizard_result
+