This question has been flagged
3262 Views

I have a field called 'name' the data which are entered in 'name' are going to the database. Whenever i want to enter a new name for example 'hello' it should show the related words which are starting from 'he'.

I am new to Python. How can we do this? I have written a function for this.


Python:

def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): 
if not args:
args = []
if context is None:
context = {}
ids = []
name = name + '%'
cr.execute("select name from learner_info where name like %s", (name,))
ids = cr.dictfetchall()
return self.name_get(cr, uid, ids, context)


XML:

<field name="name" on_change="name_search(name)"/>


How to call this function in field?

Avatar
Discard

I don't know how to accomplish this task, but I think you also need some javascript along with python code

Author

should i create another table/class for that field? I need it for particular object.