clinic/netforce_clinic/models/setting_level.py

23 lines
795 B
Python
Raw Normal View History

2014-11-21 02:39:26 +00:00
from netforce.model import Model, fields, get_model
class SettingLevel(Model):
_name="clinic.setting.level"
_string="Setting Line"
def _get_formular(self,ids,context={}):
res={}
for obj in self.browse(ids):
2014-11-21 08:34:30 +00:00
res[obj.id]=''.join(['%sX'%obj.var_a or '', obj.op or '', obj.var_b or ''])
2014-11-21 02:39:26 +00:00
return res
_fields={
"setting_id": fields.Many2One("clinic.setting","Setting"),
"level_id": fields.Many2One("clinic.personal.level","Level",domain=[['type','=','nurse']]),
'var_a': fields.Char("Ax"),
"op": fields.Selection([["+","+"],["-","-"],["*","*"],["/","/"]],"Operation"),
'var_b': fields.Char("B"),
2014-11-25 01:41:49 +00:00
'formular': fields.Text("Formular (Ax op B)",function="_get_formular"),
2014-11-21 02:39:26 +00:00
}
SettingLevel.register()