diff --git a/netforce_clinic/layouts/clinic_department_form.xml b/netforce_clinic/layouts/clinic_department_form.xml index 43c8034..82432e2 100644 --- a/netforce_clinic/layouts/clinic_department_form.xml +++ b/netforce_clinic/layouts/clinic_department_form.xml @@ -1,7 +1,7 @@
@@ -12,7 +12,7 @@ - - + + diff --git a/netforce_clinic/layouts/clinic_staff_list.xml b/netforce_clinic/layouts/clinic_staff_list.xml index 7b34364..2b39e67 100644 --- a/netforce_clinic/layouts/clinic_staff_list.xml +++ b/netforce_clinic/layouts/clinic_staff_list.xml @@ -10,6 +10,7 @@ + diff --git a/netforce_clinic/models/department.py b/netforce_clinic/models/department.py index 586b9bb..23066cc 100644 --- a/netforce_clinic/models/department.py +++ b/netforce_clinic/models/department.py @@ -30,5 +30,32 @@ class Department(Model): } _order="code" + + def share_access(self,ids,context={}): + obj=self.browse(ids)[0] + model_name='clinic.department' + model_id=None + for model in get_model("model").search_read([['name',model_name]],['name']): + model_id=model['id'] + if not model_id: + model_id=get_model("model").create({'name': model_name,'string': 'Clinic Deparment'}), + share_id=None + for share in get_model('share.access').search_read([['model_id','=', model_id]],['name']): + share_id=share['id'] + if not share_id: + share_id=get_model('share.access').create({ + 'model_id': model_id, + 'default_accesss': 'custom', + 'filter_type': 'rw', + 'select_profile': [], + }) + return { + 'next': { + 'action': 'clinic_department', + 'active_id': obj.id, + 'mode': 'form', + }, + 'flash': 'Department % s is shared sucessfully'%obj.name, + } Department.register() diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index 8f24120..a4aae52 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -1029,6 +1029,18 @@ class HDCase(Model): for payment in obj.payments: context['payment_id']=payment.id data=self.get_report_payment_data(context=context) + #XXX + count=15-len(data['lines']) + for i in range(count): + data['lines'].append({ + 'no': '', + 'product_name': '', + 'description': '', + 'uom_name': '', + 'qty': None, + 'price': None, + 'amount': None, + }) pages.append(data) if pages: pages[-1]["is_last_page"]=True diff --git a/netforce_clinic/models/setting.py b/netforce_clinic/models/setting.py index 461e040..c629c93 100644 --- a/netforce_clinic/models/setting.py +++ b/netforce_clinic/models/setting.py @@ -136,6 +136,13 @@ class ClinicSetting(Model): if user_id !=1: print("Only admin!!") return + for st in get_model("clinic.staff").search_browse([]): + st.write({ + 'note':' ', + }) + print('Done!') + return + visits={} for visit in get_model("clinic.visit").search_browse([]): key='%s-%s'%(visit.visit_date, visit.patient_id.id) diff --git a/netforce_clinic/models/shop.py b/netforce_clinic/models/shop.py index ad0569f..e271224 100644 --- a/netforce_clinic/models/shop.py +++ b/netforce_clinic/models/shop.py @@ -570,6 +570,18 @@ class Shop(Model): for obj in get_model('clinic.shop').browse(ids): context['refer_id']=obj.id data=get_model('clinic.shop').get_page(context=context) + #XXX fix 15 per page + count=15-len(data['lines']) + for i in range(count): + data['lines'].append({ + 'no': '', + 'product_name': '', + 'description': '', + 'uom_name': '', + 'qty': None, + 'price': None, + 'amount': None, + }) pages.append(data) if pages: pages[-1]["is_last_page"]=True diff --git a/netforce_clinic/models/staff.py b/netforce_clinic/models/staff.py index bc441d2..8a193bd 100644 --- a/netforce_clinic/models/staff.py +++ b/netforce_clinic/models/staff.py @@ -93,6 +93,12 @@ class Staff(Model): 'name_check': name.replace(" ",""), # remove all space for make sure } return res + + def _get_location(self,ids,context={}): + res={} + for obj in self.browse(ids): + res[obj.id]=",".join([d.code for d in obj.departments]) + return res _fields={ 'employee_id': fields.Many2One("hr.employee","Employee"), @@ -149,6 +155,7 @@ class Staff(Model): 'branch_id': fields.Many2One("clinic.branch","Branch", search=True), "partner_id": fields.Many2One("partner","Contact"), 'departments': fields.Many2Many("clinic.department","Departments"), + "location": fields.Char("Location",function="_get_location",store=True), } def _get_number(self,context={}): diff --git a/netforce_clinic/reports/cust_payment.odt b/netforce_clinic/reports/cust_payment.odt index 09241e5..02c2a99 100644 Binary files a/netforce_clinic/reports/cust_payment.odt and b/netforce_clinic/reports/cust_payment.odt differ