Skip to content
Snippets Groups Projects
Commit 720b464a77f5 authored by nhe's avatar nhe
Browse files

Added name_searchon code and description

parent 638471549bfb
No related branches found
No related tags found
No related merge requests found
...@@ -50,3 +50,30 @@ ...@@ -50,3 +50,30 @@
name = name + ' ' + record['description'] name = name + ' ' + record['description']
res.append((record['id'], name)) res.append((record['id'], name))
return res return res
def name_search(self, cr, uid, name, args=None, operator='ilike',
context=None, limit=100):
if not args:
args = []
if not context:
context = {}
ids = []
if name:
ids.extend(
self.search(cr, uid, [
'|',
('name', operator, name),
('description', operator, name)
] + args, limit=limit, context=context,
)
)
print '###'
print 'BLABLA'
print ids
return self.name_get(cr, uid, ids)
else:
return super(analytic_code, self).name_search(
cr, uid, name=name, args=args, operator=operator,
context=context, limit=limit)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment