From c2a1e047f4c536cad78dd25bc1f44a03a864e41d Mon Sep 17 00:00:00 2001 From: "watcha.h@almacom.co.th" Date: Wed, 11 Mar 2015 21:32:16 +0700 Subject: [PATCH] xxx --- netforce_clinic/models/department.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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()