clinic/netforce_clinic/models/personal_categ.py

20 lines
609 B
Python

from netforce.model import Model, fields
from netforce.access import get_active_company
class PersonalCategory(Model):
_name="clinic.personal.categ"
_string="Personal Category"
_fields={
"name": fields.Char("Name",required=True,search=True),
"type": fields.Selection([("doctor","Doctor"),("nurse","Nurse"),('other','Other')],"Type"),
'parent_id': fields.Many2One("clinic.personal.categ","Parent"),
'company_id': fields.Many2One("company","Company"),
}
_defaults={
"company_id": lambda *a: get_active_company(),
}
PersonalCategory.register()