clinic/netforce_clinic/models/branch.py

19 lines
479 B
Python
Raw Normal View History

2014-11-27 03:50:13 +00:00
from netforce.model import Model, fields
2015-01-14 07:15:10 +00:00
from netforce.access import get_active_company
2014-11-27 03:50:13 +00:00
class Branch(Model):
_name="clinic.branch"
_string="Branch"
_key=['name']
_fields={
"name": fields.Char("Name",required=True,search=True),
"parent_id": fields.Many2One("clinic.branch","Parent"),
2015-01-14 07:15:10 +00:00
"company_id": fields.Many2One("company","Company"),
}
_defaults={
"company_id": lambda *a: get_active_company(),
2014-11-27 03:50:13 +00:00
}
Branch.register()