diff --git a/netforce_clinic/models/setting.py b/netforce_clinic/models/setting.py index 2aaad60..5867964 100644 --- a/netforce_clinic/models/setting.py +++ b/netforce_clinic/models/setting.py @@ -161,21 +161,8 @@ class ClinicSetting(Model): if user_id !=1: print("Only admin!!") return - categ_ids=get_model('product.categ').search([['parent_id.code','=','MDC']]) - for prod in get_model("product").search_browse([['categ_id','in',categ_ids]]): - prod.write({ - 'report_visible': True, - }) - #for dt in get_model("district").search_browse([]): - #name=(dt.name or "")[0:1] - #dt.write({ - #'sort_name': name, - #}) - #for sdt in get_model("subdistrict").search_browse([]): - #name=(sdt.name or "")[0:1] - #sdt.write({ - #'sort_name': name, - #}) + obj=self.browse(ids)[0] + obj.merge_staff() print("Done!") def merge_staff(self,ids,context={}): diff --git a/netforce_clinic/models/staff.py b/netforce_clinic/models/staff.py index dd5c08e..8502be9 100644 --- a/netforce_clinic/models/staff.py +++ b/netforce_clinic/models/staff.py @@ -75,6 +75,7 @@ class Staff(Model): name='' title_name='' title=obj.title_id + name_check="" if title: title_name=title.name or "" title_name=title_name.replace(" ","") @@ -82,15 +83,15 @@ class Staff(Model): name+=obj.title_id.name or "" if obj.first_name: name+=obj.first_name or "" + name_check+=obj.first_name or "" name+=" " if obj.last_name: name+=obj.last_name or "" + name_check+=obj.last_name or "" if not obj.active: name+='__' elif context.get('active'): name+='__' - name_check=name.replace(" ","") - name_check=name_check.replace(title_name,"") res[obj.id]={ 'name': name, 'name_check': name_check, # remove all space for make sure