xxx
parent
1b452435d7
commit
c2a1e047f4
|
@ -40,12 +40,15 @@ class Department(Model):
|
||||||
return
|
return
|
||||||
except_perms=['Clinic Menu Settings','Clinic Staff Tab Accounting']
|
except_perms=['Clinic Menu Settings','Clinic Staff Tab Accounting']
|
||||||
other_perms=[]
|
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']
|
name=otp['name']
|
||||||
if name in except_perms:
|
if name in except_perms:
|
||||||
continue
|
continue
|
||||||
other_perms.append(otp['id'])
|
other_perms.append(otp['id'])
|
||||||
|
for model in get_model('model').search_read([['name','ilike','clinic']],['name']):
|
||||||
|
pass
|
||||||
get_model('profile').create({
|
get_model('profile').create({
|
||||||
|
'perms': perms,
|
||||||
'code': code,
|
'code': code,
|
||||||
'name': code,
|
'name': code,
|
||||||
'other_perms': [('set',other_perms)],
|
'other_perms': [('set',other_perms)],
|
||||||
|
@ -61,7 +64,7 @@ class Department(Model):
|
||||||
'active_id': obj.id,
|
'active_id': obj.id,
|
||||||
'mode': 'form',
|
'mode': 'form',
|
||||||
},
|
},
|
||||||
'flash': 'Department % s is shared sucessfully'%obj.name,
|
'flash': 'Department %s is shared sucessfully'%obj.code,
|
||||||
}
|
}
|
||||||
|
|
||||||
Department.register()
|
Department.register()
|
||||||
|
|
Loading…
Reference in New Issue