Hi !
Pretty much the whole context is in the title. It seems that my product doesn't care about the website lang, just the res.users lang. Here's my JS code:
new openerp.Session()
.rpc(rpcUrl, { 'user_input': value })
.then(function(options) {
if (options) {
$datalist.append(options;
}
});
and my python controller function called at the 'rpcUrl':
Product = request.env['product.product']
user_input = '%{}%'.format(user_input)
records = Product.search(['|', ('name', '=ilike', user_input),
('default_code', '=ilike', user_input))
if not records:
return False
return ''.join([u'<option value="{}" id="{}">{}</option>'.format(
record.display_name, record.id, record.display_name)
for record in records])
Plain and simple. However, in the page that do the rpc calls, the options appears in the language of the user. But, in the page after, I display the selected products with a t-field element, and there, the website language matters, because the products names are properly translated...
Any help, thought, idea ?