[IMP]sign in or sign out button enable if attendance group
authorPinakin Nayi (OpenERP) <pna@tinyerp.com>
Mon, 24 Sep 2012 05:17:24 +0000 (10:47 +0530)
committerPinakin Nayi (OpenERP) <pna@tinyerp.com>
Mon, 24 Sep 2012 05:17:24 +0000 (10:47 +0530)
bzr revid: pna@tinyerp.com-20120924051724-m5b74g2kfw8c337h

addons/hr_attendance/hr_attendance.py
addons/hr_attendance/static/src/js/attendance.js

index 3a704e8..626fd45 100644 (file)
@@ -129,11 +129,12 @@ class hr_employee(osv.osv):
     def _attendance_access(self, cr, uid, ids, name, args, context=None):
         res = {}
         data_obj = self.pool.get('ir.model.data')
-        group = data_obj.get_object(cr, uid,'hr_attendance', 'hr_attendace_group')
-        if uid in [user.id for user in group.user]:
-            res[ids] = True
-        else:
-            res[ids] = False
+        group = data_obj.get_object(cr, uid, 'base', 'group_hr_attendance')
+        for id in ids :
+            if uid in [user.id for user in group.users]:
+                res[id] = True
+            else:
+                res[id] = False
         return res
 
     _columns = {
index 0068b49..d92e753 100644 (file)
@@ -60,7 +60,7 @@ openerp.hr_attendance = function (instance) {
             return employee.read_slice(['id', 'name', 'state', 'last_sign', 'attendance_access']).pipe(function (res) {
                 if (_.isEmpty(res) )
                     return;
-                if (res['attendance_access'] == false){
+                if (res[0].attendance_access == false){
                     return;
                 }
                 self.$el.show();