clinic/netforce_clinic/models/hd_case_dialyzer.py

30 lines
1.1 KiB
Python
Raw Normal View History

2014-10-02 19:12:52 +00:00
from netforce.model import Model, fields
2014-11-21 17:31:10 +00:00
class HDCaseDialyzerLine(Model):
2014-10-02 19:12:52 +00:00
_name="clinic.hd.case.dialyzer"
2015-01-29 14:55:05 +00:00
def _get_all(self,ids,context={}):
res={}
for obj in self.browse(ids):
2015-08-18 11:18:12 +00:00
hdcase_date=obj.hd_case_id.date
2015-01-29 14:55:05 +00:00
res[obj.id]={
2015-08-18 11:18:12 +00:00
'hdcase_date': hdcase_date,
2015-01-29 14:55:05 +00:00
}
return res
2014-10-02 19:12:52 +00:00
_fields={
2015-08-18 11:18:12 +00:00
"hd_case_id": fields.Many2One("clinic.hd.case","HDCase",on_delete="cascade"),
2015-01-29 14:55:05 +00:00
"dialyzer_type": fields.Selection([("low","low flux"),("high","high flux"),("dbl","dbl hifulx")],"Dialyzer Type"),
2015-01-23 04:29:50 +00:00
"dialyzer_id": fields.Many2One("clinic.dialyzer","Dialyzer",search=True),
2014-10-02 19:12:52 +00:00
"description": fields.Char("Description",search=True),
"use_time":fields.Integer("Use time"),
"max_use_time":fields.Integer("Max use time"),
2015-02-10 05:22:04 +00:00
"membrane_type": fields.Selection([("unsub","Unsub cellul"),("sub","Sub cellul"),("synthetic","Synthetic")],"Membrane Type"),
2015-08-18 11:18:12 +00:00
'hdcase_date': fields.Date('Date', function="_get_all",function_multi=True),
2014-10-02 19:12:52 +00:00
}
2015-08-18 11:18:12 +00:00
_order="hd_case_id.date desc"
2014-11-21 17:31:10 +00:00
HDCaseDialyzerLine.register()
2014-10-02 19:12:52 +00:00