clinic/netforce_clinic/models/hd_case_dialyzer.py

27 lines
1.0 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):
dlz=obj.dialyzer_id
res[obj.id]={
'membrane_type': dlz.membrane_type,
}
return res
2014-10-02 19:12:52 +00:00
_fields={
2014-11-21 17:31:10 +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-01-29 14:55:05 +00:00
"membrane_type": fields.Selection([("unsub","Unsub cellul"),("sub","Sub cellul"),("synthetic","Synthetic")],"Membrane Type",function="_get_all",function_multi=True),
2014-10-02 19:12:52 +00:00
}
2014-11-21 17:31:10 +00:00
HDCaseDialyzerLine.register()
2014-10-02 19:12:52 +00:00