this is my py file
@http.route('/some/route/', website=True, type='json', auth='public', csrf=False)
@http.route('/some/route/', website=True, type='json', auth='public', csrf=False)
def get_data(self, **kw):
condition = kw['some']
sql = """
select name from res_partner where phone = '%s' or email = '%s'
""" % (condition)
http.request.cr.execute(sql)
result = http.request.cr.fetchall() or []
data = []
list(data)
for x in result:
temp = ''.join(x)
data.append(temp)
print(data)
return http.request.render("custom_search.get_data", {
'data': data
})
js file
js file
rpc.query({
route: '/some/route/',
params: { some: search.Input }
})
i have error 'JsonRequest' object has no attribute 'render'
i try send request by ajax but it not auto redirect to /some/route
can i get any solution to render xml template like httprequest