clinic/netforce_clinic/models/branch.py

20 lines
542 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),
2015-01-14 13:36:23 +00:00
"code": fields.Char("Code",required=True,search=True),
2014-11-27 03:50:13 +00:00
"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()