diff --git a/netforce_clinic/models/department.py b/netforce_clinic/models/department.py index 2380a8a..ac0bedb 100644 --- a/netforce_clinic/models/department.py +++ b/netforce_clinic/models/department.py @@ -40,12 +40,15 @@ class Department(Model): return except_perms=['Clinic Menu Settings','Clinic Staff Tab Accounting'] other_perms=[] - for otp in get_model('permission').search(['name','ilike','clinic'],['name']): + for otp in get_model('permission').search_read(['name','ilike','clinic'],['name']): name=otp['name'] if name in except_perms: continue other_perms.append(otp['id']) + for model in get_model('model').search_read([['name','ilike','clinic']],['name']): + pass get_model('profile').create({ + 'perms': perms, 'code': code, 'name': code, 'other_perms': [('set',other_perms)], @@ -61,7 +64,7 @@ class Department(Model): 'active_id': obj.id, 'mode': 'form', }, - 'flash': 'Department % s is shared sucessfully'%obj.name, + 'flash': 'Department %s is shared sucessfully'%obj.code, } Department.register()