[IMP]sign in or sign out button enable if attendance group
bzr revid: pna@tinyerp.com-20120924051724-m5b74g2kfw8c337h
This commit is contained in:
parent
008d5d35d7
commit
4d9fa19122
|
@ -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 = {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue