run script
parent
c3760db0e0
commit
c84fc31946
|
@ -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={}):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue