i success to search with name but i can't do autocompletion when typing this is my code
def result2(self, page=0, search=''):
Contacts = http.request.env['res.partner']
# search
domain = []
if search:
domain = [('name', 'ilike', search)]
total_customers = request.env['res.partner'].search(domain)
total_count = len(total_customers)
per_page = 12
pager = request.website.pager(url='/academy/resultat2', total=total_count, page=page, step=per_page, scope=3,
url_args=None)
customers = request.env['res.partner'].search(domain, limit=per_page, offset=pager['offset'], order='id asc')
longueur = len(customers)
values = {
'customers': customers,
'pager': pager,
'contacts': Contacts.search([]),
'valeur': search,
'length': longueur,
}
return request.render('homepage.result2', values)