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): res[obj.id]=''.join(['%sX'%obj.var_a or '', obj.op or '', obj.var_b or '']) return res _fields={ "setting_id": fields.Many2One("clinic.setting","Setting"), "level_id": fields.Many2One("clinic.staff.level","Level",domain=[['type','=','nurse']]), 'var_a': fields.Char("Ax"), "op": fields.Selection([["+","+"],["-","-"]],"Operation"), 'var_b': fields.Char("B"), 'formular': fields.Text("Formular (Ax op B)",function="_get_formular"), } SettingLevel.register()