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"),
|
2014-11-25 11:39:53 +00:00
|
|
|
"level_id": fields.Many2One("clinic.staff.level","Level",domain=[['type','=','nurse']]),
|
2014-11-21 02:39:26 +00:00
|
|
|
'var_a': fields.Char("Ax"),
|
2014-11-26 16:04:58 +00:00
|
|
|
"op": fields.Selection([["+","+"],["-","-"]],"Operation"),
|
2014-11-21 02:39:26 +00:00
|
|
|
'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()
|