clinic/netforce_clinic/models/personal_categ.py

20 lines
609 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
2014-11-02 01:26:42 +00:00
class PersonalCategory(Model):
2014-10-26 15:17:56 +00:00
_name="clinic.personal.categ"
_string="Personal Category"
_fields={
"name": fields.Char("Name",required=True,search=True),
2014-11-02 02:13:15 +00:00
"type": fields.Selection([("doctor","Doctor"),("nurse","Nurse"),('other','Other')],"Type"),
2014-11-02 01:26:42 +00:00
'parent_id': fields.Many2One("clinic.personal.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-10-26 15:17:56 +00:00
}
2014-11-02 01:26:42 +00:00
PersonalCategory.register()