clinic/netforce_clinic/models/staff_categ.py

23 lines
663 B
Python
Raw Normal View History

2014-10-26 15:17:56 +00:00
from netforce.model import Model, fields
2014-11-10 11:33:01 +00:00
from netforce.access import get_active_company
2014-10-26 15:17:56 +00:00
class StaffCategory(Model):
_name="clinic.staff.categ"
_string="Staff Category"
2014-11-26 11:35:44 +00:00
_key=["name"]
2015-01-09 05:19:52 +00:00
_multi_company=True
2014-10-26 15:17:56 +00:00
_fields={
"name": fields.Char("Name",required=True,search=True),
"type": fields.Selection([("doctor","Doctor"),("nurse","Nurse"),('others','Others')],"Type"),
'parent_id': fields.Many2One("clinic.staff.categ","Parent"),
2014-11-10 11:33:01 +00:00
'company_id': fields.Many2One("company","Company"),
}
_defaults={
"company_id": lambda *a: get_active_company(),
2014-11-25 15:22:50 +00:00
'type': 'nurse',
2014-10-26 15:17:56 +00:00
}
StaffCategory.register()