2014-11-14 01:58:12 +00:00
|
|
|
from netforce.model import Model, fields
|
|
|
|
|
|
|
|
class ScheduleLine(Model):
|
|
|
|
_name="clinic.schedule.line"
|
|
|
|
_string="Schedule Line"
|
2014-11-21 02:39:26 +00:00
|
|
|
|
|
|
|
def _get_level(self,ids,context={}):
|
|
|
|
res={}
|
|
|
|
for obj in self.browse(ids):
|
|
|
|
res[obj.id]=obj.nurse_id.level_id.id
|
|
|
|
return res
|
2014-11-22 05:44:41 +00:00
|
|
|
|
2014-11-14 01:58:12 +00:00
|
|
|
_fields={
|
|
|
|
'schedule_id': fields.Many2One("clinic.schedule","Schedule"),
|
|
|
|
'cycle_id': fields.Many2One("clinic.cycle","Cycle"),
|
2014-11-22 05:44:41 +00:00
|
|
|
'cycle_item_id': fields.Many2One("clinic.cycle.item","Cycle Item"),
|
2014-11-14 01:58:12 +00:00
|
|
|
"nurse_id": fields.Many2One("clinic.personal","Nurse",domain=[['type','=','nurse']]),
|
2014-11-21 02:39:26 +00:00
|
|
|
'level_id': fields.Many2One("clinic.personal.level","Level",function="_get_level"),
|
2014-11-14 01:58:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ScheduleLine.register()
|