From 400c56e2cfab176979b37e8b3c19551c3cb2e8a3 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Wed, 25 Feb 2015 16:47:20 +0700 Subject: [PATCH] xxx --- netforce_clinic/layouts/clinic_staff_form.xml | 2 +- netforce_clinic/models/setting.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/netforce_clinic/layouts/clinic_staff_form.xml b/netforce_clinic/layouts/clinic_staff_form.xml index 1d107fc..5a0b1a7 100644 --- a/netforce_clinic/layouts/clinic_staff_form.xml +++ b/netforce_clinic/layouts/clinic_staff_form.xml @@ -12,7 +12,7 @@ - + diff --git a/netforce_clinic/models/setting.py b/netforce_clinic/models/setting.py index 1759467..7fd4d6f 100644 --- a/netforce_clinic/models/setting.py +++ b/netforce_clinic/models/setting.py @@ -106,13 +106,20 @@ class ClinicSetting(Model): return True def run_script(self,ids,context={}): + user_id=get_active_user() + if user_id !=1: + print("Only admin!!") + return + print("Done!") + + def update_name(self,ids,context={}): user_id=get_active_user() if user_id !=1: print("Only admin!!") return titles=dict([(t.name, t.id) for t in get_model("clinic.name.title").search_browse([])]) title_id=None - gtile_id=title_id + gtitle_id=title_id for name, tid in titles.items(): if name=='No Title': gtitle_id=tid @@ -230,6 +237,9 @@ class ClinicSetting(Model): 'last_name': names[1], }) else: + vals.update({ + 'first_name':name, + }) print(name) st.write(vals) if not st.gender: