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-25 11:39:53 +00:00
|
|
|
class StaffCategory(Model):
|
|
|
|
_name="clinic.staff.categ"
|
|
|
|
_string="Staff Category"
|
2014-10-26 15:17:56 +00:00
|
|
|
|
|
|
|
_fields={
|
|
|
|
"name": fields.Char("Name",required=True,search=True),
|
2014-11-25 11:39:53 +00:00
|
|
|
"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
|
|
|
}
|
|
|
|
|
2014-11-25 11:39:53 +00:00
|
|
|
StaffCategory.register()
|