[IMP] hr_attendance: performance improvement
has_group is cached and do not fetch all the users with a slow `group.users`
This commit is contained in:
parent
eaa32e51dd
commit
9d4bea10eb
|
@ -149,10 +149,7 @@ class hr_employee(osv.osv):
|
|||
|
||||
def _attendance_access(self, cr, uid, ids, name, args, context=None):
|
||||
# this function field use to hide attendance button to singin/singout from menu
|
||||
group = self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'group_hr_attendance')
|
||||
visible = False
|
||||
if uid in [user.id for user in group.users]:
|
||||
visible = True
|
||||
visible = self.pool.get("res.users").has_group(cr, uid, "base.group_hr_attendance")
|
||||
return dict([(x, visible) for x in ids])
|
||||
|
||||
_columns = {
|
||||
|
|
Loading…
Reference in New Issue