diff --git a/netforce_clinic/actions/clinic_personal_level.xml b/netforce_clinic/actions/clinic_personal_level.xml new file mode 100644 index 0000000..fd79478 --- /dev/null +++ b/netforce_clinic/actions/clinic_personal_level.xml @@ -0,0 +1,7 @@ + + Personal Levels + multi_view + clinic.personal.level + list,page,form + clinic_menu + diff --git a/netforce_clinic/layouts/clinic_gen_visit_form.xml b/netforce_clinic/layouts/clinic_gen_visit_form.xml index c898093..0add4fe 100644 --- a/netforce_clinic/layouts/clinic_gen_visit_form.xml +++ b/netforce_clinic/layouts/clinic_gen_visit_form.xml @@ -7,8 +7,8 @@ - + diff --git a/netforce_clinic/layouts/clinic_hd_case_form.xml b/netforce_clinic/layouts/clinic_hd_case_form.xml index 9faddee..d852095 100644 --- a/netforce_clinic/layouts/clinic_hd_case_form.xml +++ b/netforce_clinic/layouts/clinic_hd_case_form.xml @@ -93,7 +93,10 @@ - + + + + diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml index ff56fd5..435e082 100644 --- a/netforce_clinic/layouts/clinic_menu.xml +++ b/netforce_clinic/layouts/clinic_menu.xml @@ -5,8 +5,9 @@ -
- +
+ + diff --git a/netforce_clinic/layouts/clinic_patient_categ_form.xml b/netforce_clinic/layouts/clinic_patient_categ_form.xml index 6a8ab1c..20b6d00 100644 --- a/netforce_clinic/layouts/clinic_patient_categ_form.xml +++ b/netforce_clinic/layouts/clinic_patient_categ_form.xml @@ -1,4 +1,4 @@
- + diff --git a/netforce_clinic/layouts/clinic_patient_categ_list.xml b/netforce_clinic/layouts/clinic_patient_categ_list.xml index 218b948..3da6f47 100644 --- a/netforce_clinic/layouts/clinic_patient_categ_list.xml +++ b/netforce_clinic/layouts/clinic_patient_categ_list.xml @@ -1,4 +1,4 @@ - + diff --git a/netforce_clinic/layouts/clinic_patient_form.xml b/netforce_clinic/layouts/clinic_patient_form.xml index 6022cb0..78aa49a 100644 --- a/netforce_clinic/layouts/clinic_patient_form.xml +++ b/netforce_clinic/layouts/clinic_patient_form.xml @@ -8,14 +8,13 @@ - - + @@ -88,6 +87,7 @@ + diff --git a/netforce_clinic/layouts/clinic_personal_categ_form.xml b/netforce_clinic/layouts/clinic_personal_categ_form.xml index 1219e0b..130ec52 100644 --- a/netforce_clinic/layouts/clinic_personal_categ_form.xml +++ b/netforce_clinic/layouts/clinic_personal_categ_form.xml @@ -1,7 +1,4 @@
- - - - + diff --git a/netforce_clinic/layouts/clinic_personal_categ_list.xml b/netforce_clinic/layouts/clinic_personal_categ_list.xml index baea06c..1c05326 100644 --- a/netforce_clinic/layouts/clinic_personal_categ_list.xml +++ b/netforce_clinic/layouts/clinic_personal_categ_list.xml @@ -1,7 +1,4 @@ - - - - + diff --git a/netforce_clinic/layouts/clinic_personal_form.xml b/netforce_clinic/layouts/clinic_personal_form.xml index 0dcca0c..cc4898d 100644 --- a/netforce_clinic/layouts/clinic_personal_form.xml +++ b/netforce_clinic/layouts/clinic_personal_form.xml @@ -16,6 +16,7 @@ + diff --git a/netforce_clinic/layouts/clinic_personal_level_form.xml b/netforce_clinic/layouts/clinic_personal_level_form.xml new file mode 100644 index 0000000..c4e7743 --- /dev/null +++ b/netforce_clinic/layouts/clinic_personal_level_form.xml @@ -0,0 +1,7 @@ +
+ + + + + + diff --git a/netforce_clinic/layouts/clinic_personal_level_list.xml b/netforce_clinic/layouts/clinic_personal_level_list.xml new file mode 100644 index 0000000..dc21ae4 --- /dev/null +++ b/netforce_clinic/layouts/clinic_personal_level_list.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/netforce_clinic/models/__init__.py b/netforce_clinic/models/__init__.py index 141dd71..269f6e9 100644 --- a/netforce_clinic/models/__init__.py +++ b/netforce_clinic/models/__init__.py @@ -48,5 +48,6 @@ from . import payment from . import account_payment from . import account_invoice from . import personal_categ +from . import personal_level from . import personal from . import schedule diff --git a/netforce_clinic/models/gen_visit.py b/netforce_clinic/models/gen_visit.py index 07cdc11..b90590b 100644 --- a/netforce_clinic/models/gen_visit.py +++ b/netforce_clinic/models/gen_visit.py @@ -251,7 +251,7 @@ class GenVisit(Model): 'name': 'clinic_gen_visit_form', 'mode': 'form', }, - 'flash': 'Clear OK', + 'flash': 'Clear %s visits'%len(vids), } if days: @@ -310,7 +310,7 @@ class GenVisit(Model): 'name': 'clinic_visit', 'mode': 'list', }, - 'flash': 'Clear OK', + 'flash': 'Clear %s visits'%len(visit_ids), } GenVisit.register() diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index 0b03a05..8205eca 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -34,7 +34,7 @@ class HDCase(Model): "time_stop": fields.DateTime("Time stop",required=True,search=True), "date": fields.Date("Time stop",required=True,search=True), "patient_id": fields.Many2One("clinic.patient","Patient",required=True,search=True), - "nurse_id": fields.Many2One("clinic.personal","Approve By", domain=[['type','=','nurse']],required=True), + "nurse_id": fields.Many2One("clinic.personal","Approve By", domain=[['type','=','nurse']]), "department_id": fields.Many2One("clinic.department", "Department",search=True), "wh_start": fields.Float("Wt.Kg start"), "wh_stop": fields.Float("Wt.Kg stop"), diff --git a/netforce_clinic/models/patient.py b/netforce_clinic/models/patient.py index 2f0d650..f92d994 100644 --- a/netforce_clinic/models/patient.py +++ b/netforce_clinic/models/patient.py @@ -76,10 +76,10 @@ class Patient(Model): "hd_cases": fields.One2Many("clinic.hd.case","patient_id","HD Cases"), "partner_id": fields.Many2One("partner","Contact"), "dialyzers": fields.One2Many("clinic.dialyzer","patient_id","Dialyzers"), - "active":fields.Boolean("Active"), + "active":fields.Boolean("Mark as discountinue"), 'note': fields.Text("Note"), 'categ_id': fields.Many2One("clinic.patient.categ","Category"), - + 'doctor_id': fields.Many2One("clinic.personal","Doctor",domain=[['type','=','doctor']]), } def _get_number(self,context={}): diff --git a/netforce_clinic/models/patient_categ.py b/netforce_clinic/models/patient_categ.py index d9070f7..c510647 100644 --- a/netforce_clinic/models/patient_categ.py +++ b/netforce_clinic/models/patient_categ.py @@ -6,7 +6,7 @@ class PatientCateg(Model): _fields={ "name": fields.Char("Name",required=True,search=True), - "code": fields.Char("Code",search=True), + "parent_id": fields.Many2One('clinic.patient.categ',"Parent"), } PatientCateg.register() diff --git a/netforce_clinic/models/personal.py b/netforce_clinic/models/personal.py index a39b49a..d3a54ad 100644 --- a/netforce_clinic/models/personal.py +++ b/netforce_clinic/models/personal.py @@ -46,6 +46,7 @@ class Personal(Model): 'picture': fields.File("Picture"), 'note': fields.Text("Note"), 'categ_id': fields.Many2One("clinic.personal.categ", "Category"), + 'level_id': fields.Many2One("clinic.personal.level", "Level"), 'active': fields.Boolean("Active"), 'date': fields.Date("Register Date"), } diff --git a/netforce_clinic/models/personal_categ.py b/netforce_clinic/models/personal_categ.py index 98ba862..2f38cf4 100644 --- a/netforce_clinic/models/personal_categ.py +++ b/netforce_clinic/models/personal_categ.py @@ -1,44 +1,12 @@ from netforce.model import Model, fields -from netforce.access import get_active_company -class PersonalCateg(Model): +class PersonalCategory(Model): _name="clinic.personal.categ" _string="Personal Category" _fields={ "name": fields.Char("Name",required=True,search=True), - "code": fields.Char("Code",required=True,search=True), - 'formular': fields.Text("Formular"), - 'sequence': fields.Integer("Sequence"), - "type": fields.Selection([("doctor","Doctor"),("nurse","Nurse")],"Personal Type",required=True), + 'parent_id': fields.Many2One("clinic.personal.categ","Parent"), } - _defaults={ - "company_id": lambda *a: get_active_company(), - 'sequence': 0, - 'type': 'doctor', - 'formular': '', - } - - _order="sequence" - - def name_get(self,ids,context={}): - vals=[] - for obj in self.browse(ids): - name="%s [%s]"%(obj.name,obj.code or "") - vals.append((obj.id,name)) - return vals - - def name_search(self,name,domain=None,context={},**kw): - dom=[["name","ilike","%"+name+"%"]] - if domain: - dom=[dom,domain] - ids1=self.search(dom) - dom=[["code","ilike","%"+name+"%"]] - if domain: - dom=[dom,domain] - ids2=self.search(dom) - ids=list(set(ids1+ids2)) - return self.name_get(ids,context=context) - -PersonalCateg.register() +PersonalCategory.register() diff --git a/netforce_clinic/models/personal_level.py b/netforce_clinic/models/personal_level.py new file mode 100644 index 0000000..95132d4 --- /dev/null +++ b/netforce_clinic/models/personal_level.py @@ -0,0 +1,25 @@ +from netforce.model import Model, fields +from netforce.access import get_active_company + +class PersonalLevel(Model): + _name="clinic.personal.level" + _string="Personal Level" + + _fields={ + "name": fields.Char("Name",required=True,search=True), + 'formular': fields.Text("Formular"), + 'description': fields.Text("Description"), + 'sequence': fields.Integer("Sequence"), + "type": fields.Selection([("doctor","Doctor"),("nurse","Nurse")],"Personal Type",required=True), + } + + _defaults={ + "company_id": lambda *a: get_active_company(), + 'sequence': 0, + 'type': 'nurse', + 'formular': '', + } + + _order="sequence" + +PersonalLevel.register() diff --git a/netforce_clinic/models/visit.py b/netforce_clinic/models/visit.py index ff32ba4..e9425d1 100644 --- a/netforce_clinic/models/visit.py +++ b/netforce_clinic/models/visit.py @@ -288,6 +288,7 @@ class Visit(Model): def create(self, vals,**kw): date=vals['time_start'][0:10] cycle_id=vals['cycle_id'] + cycle=get_model("clinic.cycle").browse(cycle_id) dom=[] dom.append(['date','=',date]) dom.append(['cycle_id','=',cycle_id]) @@ -302,7 +303,7 @@ class Visit(Model): else: item_id=item_ids[0] vals['cycle_item_id']=item_id - vals['sequence']='%s-%s'%(vals['time_start'][0:10],cycle_id) + vals['sequence']='%s-%s'%(vals['time_start'][0:10],cycle.sequence) #date-sequence obj_id=super().create(vals,**kw) return obj_id