Computed fields indicates many2one and one2many filed in selection filed . For example you can see below code in you .py file .
test = fields.Char(compute='_compute_upper',
inverse='_inverse_test',
search='_search_test')
@api.depends('name')
def _compute_test(self):
for rec in self:
rec. test = rec.name.test () if rec.name else False
def _inverse_test(self):
for rec in self:
rec.name = rec.test.lower() if rec. test else False
def _search_test(self, operator, value):
if operator == 'like':
operator = 'ilike'
return [('name', operator, value)]
Note with the help of this code you can set your selection fileds and api.
0 Comment(s)