From dbb4d6420f4a1018814eff678cab27ab78964b2c Mon Sep 17 00:00:00 2001 From: "watcha.h@almacom.co.th" Date: Wed, 14 Jan 2015 14:15:10 +0700 Subject: [PATCH] xxx --- netforce_clinic/layouts/clinic_branch_form.xml | 3 ++- netforce_clinic/models/branch.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/netforce_clinic/layouts/clinic_branch_form.xml b/netforce_clinic/layouts/clinic_branch_form.xml index 98d4f3c..ab07514 100644 --- a/netforce_clinic/layouts/clinic_branch_form.xml +++ b/netforce_clinic/layouts/clinic_branch_form.xml @@ -1,4 +1,5 @@ -
+ + diff --git a/netforce_clinic/models/branch.py b/netforce_clinic/models/branch.py index 672d15e..3516d2e 100644 --- a/netforce_clinic/models/branch.py +++ b/netforce_clinic/models/branch.py @@ -1,4 +1,5 @@ from netforce.model import Model, fields +from netforce.access import get_active_company class Branch(Model): _name="clinic.branch" @@ -7,6 +8,11 @@ class Branch(Model): _fields={ "name": fields.Char("Name",required=True,search=True), "parent_id": fields.Many2One("clinic.branch","Parent"), + "company_id": fields.Many2One("company","Company"), + } + + _defaults={ + "company_id": lambda *a: get_active_company(), } Branch.register()