conv_bal
watcha.h@almacom.co.th 2015-01-14 14:15:10 +07:00
parent 7eda2f6369
commit dbb4d6420f
2 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,5 @@
<form model="clinic.branch"> <form model="clinic.branch" show_company="1">
<field name="name"/> <field name="name"/>
<field name="parent_id"/> <field name="parent_id"/>
<field name="company_id" invisible="1"/>
</form> </form>

View File

@ -1,4 +1,5 @@
from netforce.model import Model, fields from netforce.model import Model, fields
from netforce.access import get_active_company
class Branch(Model): class Branch(Model):
_name="clinic.branch" _name="clinic.branch"
@ -7,6 +8,11 @@ class Branch(Model):
_fields={ _fields={
"name": fields.Char("Name",required=True,search=True), "name": fields.Char("Name",required=True,search=True),
"parent_id": fields.Many2One("clinic.branch","Parent"), "parent_id": fields.Many2One("clinic.branch","Parent"),
"company_id": fields.Many2One("company","Company"),
}
_defaults={
"company_id": lambda *a: get_active_company(),
} }
Branch.register() Branch.register()