This is a very simple but a difficult question to answer, because I think only a "few" people work with this.
I have this simple script in Python:
import xmlrpclib
username = 'my_openerp_user'
pwd = 'my_password'
dbname = 'my_openerp_database'
sock = xmlrpclib.ServerProxy('http://localhost:8063/xmlrpc/common')
uid = sock.login(dbname, username, pwd)
sock = xmlrpclib.ServerProxy('http://localhost:8063/xmlrpc/object')
args = [('name', 'ilike', 'my_product')]
ids = sock.execute(dbname, uid, pwd, 'product.product', 'search', args)
print ids
It should find all the products in the OpenERP database with the name 'my_product', but it does not. And I know why:
I am not in a country in which English is talked, so I have one language installed in OpenERP, and the 'search' of xmlrpc is looking for products with name 'my_product' but only in english. The problem is that apparently there is not a field to save the translated name... It seems to be 'name' too! So I can't find the products if I specify their names in my language.
Anyone in the world had the same problem?
EDIT
Ok, I have a clue: if instead of doing 'search', I do 'read':
product_names = sock.execute(dbname, uid, pwd, 'product.product', 'read', ids, ['name'], {'lang': 'es_ES'})
This way I can specify the language and it works! But I can't do the same with 'search', I get errors. Anyone knows the way???
NEW EDIT
context = {'lang': 'es_ES'}
args = [('name', 'ilike', 'my_product')] # consulta
ids = sock.execute(dbname, uid, pwd, 'product.product', 'search', args, context)