From 2ee03fbb9cd221d40098a852a8aa076514cb7879 Mon Sep 17 00:00:00 2001 From: "chayut.s" Date: Wed, 1 Oct 2014 14:50:42 +0700 Subject: [PATCH] Complete Customize Add fields Doctor --- .../layouts/clinic_doctor_form.xml | 33 +++++++++++------- netforce_clinic/models/clinic_doctor.py | 34 +++++++++++-------- 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/netforce_clinic/layouts/clinic_doctor_form.xml b/netforce_clinic/layouts/clinic_doctor_form.xml index 3a026ba..15ca618 100644 --- a/netforce_clinic/layouts/clinic_doctor_form.xml +++ b/netforce_clinic/layouts/clinic_doctor_form.xml @@ -5,18 +5,27 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/netforce_clinic/models/clinic_doctor.py b/netforce_clinic/models/clinic_doctor.py index 8206cc1..bc794f7 100644 --- a/netforce_clinic/models/clinic_doctor.py +++ b/netforce_clinic/models/clinic_doctor.py @@ -11,20 +11,26 @@ class Doctor(Model): _name_field="name" _multi_company=True _fields={ - "number": fields.Char("Number",required=True,search=True), - "name": fields.Char("Name",required=True,search=True), + "number": fields.Char("Doctor No.",required=True,search=True), + "name": fields.Char("First name",required=True,search=True), + "last_name" : fields.Char("Last name",required=False), "date": fields.Date("Create Date",required=True,search=True), - "birthday": fields.Date("BirthDay",required=True,search=True), - "telephone": fields.Char("Telephone",required=True,search=True), - "department": fields.Char("Department",required=True,search=True), - "mobile": fields.Char("Mobile",required=True,search=True), + "card_id" : fields.Char("Identity ID"), + "card_expire" : fields.Date("Expire Date"), + "birthday": fields.Date("Date of birth",required=False,search=True), + "telephone": fields.Char("Telephone",required=False,search=True), + "department": fields.Selection([("temporary","Temporary"),("permanent","Permanent")], "Dapartment"), + "mobile": fields.Char("Mobile",required=False,search=True), + #"licen" : fields.char("licens medicine No."), + "number2" : fields.Char("Licen medical No."), + "licen_issued" : fields.Date("Issued on"), "state": fields.Selection([("draft","Draft"),("active","Active"),("deactive","Deactive")],"Status",required=True), - "addresses": fields.One2Many("address","related_id","Addresses"), - "comments": fields.One2Many("message","related_id","Comments"), - "patients": fields.Many2Many("clinic.patient","Patients"), - "visits": fields.One2Many("clinic.visit","doctor_id","Visits"), - "hd_cases": fields.One2Many("clinic.hd.case","doctor_id","HD Cases"), - "company_id": fields.Many2One("company","Company"), + "addresses" : fields.One2Many("address","related_id","Addresses"), + "comments" : fields.One2Many("message","related_id","Comments"), + "patients" : fields.Many2Many("clinic.patient","Patients"), + "visits" : fields.One2Many("clinic.visit","doctor_id","Visits"), + "hd_cases" : fields.One2Many("clinic.hd.case","doctor_id","HD Cases"), + "company_id" : fields.Many2One("company","Company"), } def _get_number(self,context={}): @@ -35,7 +41,7 @@ class Doctor(Model): res=self.search([["number","=",num]]) if not res: return num - get_model("sequence").increment("sale_order") + get_model("sequence") .increment("sale_order") _defaults={ @@ -50,7 +56,7 @@ class Doctor(Model): def void(self,ids,context={}): obj=self.browse(ids)[0] - obj.write({"state":"voided"}) + obj.write({"state":"voided "}) Doctor.register()