From f8d0f01cdcfe1f8d725d1b69164b27ba86458157 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Tue, 17 Mar 2015 16:29:34 +0700 Subject: [PATCH] add branch to sequence --- netforce_clinic/layouts/clinic_address_form.xml | 5 +++++ netforce_clinic/layouts/clinic_branch_form.xml | 2 ++ netforce_clinic/layouts/clinic_sequence_form.xml | 5 +++++ netforce_clinic/models/__init__.py | 2 ++ netforce_clinic/models/address.py | 9 +-------- netforce_clinic/models/branch.py | 1 + netforce_clinic/models/sequence.py | 10 ++++++++++ 7 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 netforce_clinic/layouts/clinic_address_form.xml create mode 100644 netforce_clinic/layouts/clinic_sequence_form.xml create mode 100644 netforce_clinic/models/sequence.py diff --git a/netforce_clinic/layouts/clinic_address_form.xml b/netforce_clinic/layouts/clinic_address_form.xml new file mode 100644 index 0000000..09a21cc --- /dev/null +++ b/netforce_clinic/layouts/clinic_address_form.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/netforce_clinic/layouts/clinic_branch_form.xml b/netforce_clinic/layouts/clinic_branch_form.xml index 279bba4..13f8088 100644 --- a/netforce_clinic/layouts/clinic_branch_form.xml +++ b/netforce_clinic/layouts/clinic_branch_form.xml @@ -9,6 +9,8 @@ + + diff --git a/netforce_clinic/layouts/clinic_sequence_form.xml b/netforce_clinic/layouts/clinic_sequence_form.xml new file mode 100644 index 0000000..69cc5e9 --- /dev/null +++ b/netforce_clinic/layouts/clinic_sequence_form.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/netforce_clinic/models/__init__.py b/netforce_clinic/models/__init__.py index 819bdc6..77bd07f 100644 --- a/netforce_clinic/models/__init__.py +++ b/netforce_clinic/models/__init__.py @@ -121,3 +121,5 @@ from . import select_company from . import name_title from . import compute_labor_cost from . import login +from . import address +from . import sequence diff --git a/netforce_clinic/models/address.py b/netforce_clinic/models/address.py index 1d3b3da..df8c8a1 100644 --- a/netforce_clinic/models/address.py +++ b/netforce_clinic/models/address.py @@ -1,16 +1,9 @@ from netforce.model import Model, fields -from pprint import pprint class Address(Model): _inherit="address" - _fields={ - "patient_id": fields.Many2One("clinic.patient","Patient",domain=[['state','=','admit']]), - "staff_id": fields.Many2One("clinic.staff","Staff"), + 'fax': fields.Char("Fax"), } - - def write(self,ids,vals,**kw): - pprint(vals) - super().write(ids,vals,**kw) Address.register() diff --git a/netforce_clinic/models/branch.py b/netforce_clinic/models/branch.py index b5a402b..c393c45 100644 --- a/netforce_clinic/models/branch.py +++ b/netforce_clinic/models/branch.py @@ -12,6 +12,7 @@ class Branch(Model): "company_id": fields.Many2One("company","Company"), 'departments': fields.One2Many("clinic.department","branch_id","Departments"), 'active': fields.Boolean("Active"), + "addresses": fields.One2Many("address","related_id","Addresses"), } _defaults={ diff --git a/netforce_clinic/models/sequence.py b/netforce_clinic/models/sequence.py new file mode 100644 index 0000000..8aedbec --- /dev/null +++ b/netforce_clinic/models/sequence.py @@ -0,0 +1,10 @@ +from netforce.model import Model, fields + +class Sequence(Model): + _inherit="sequence" + _fields={ + 'fax': fields.Char("Fax"), + 'branch_id': fields.Many2One("clinic.branch","Branch"), + } + +Sequence.register()