Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Hello everybody (this is my first post),
I use a API client to request a Odoo (version 9e) instance. When I fetch one specific product I want to have its name in all different languages set in the instance (actually French and Spanish).
I can only have it in French which is my main language. I tried to use a user/password which is language is set in Spanish but I get always the French version. How can I fetch this product name in Spanish ?
fetch all active langs and copy the context re-run your products queries by setting the context language over loop. that should get you what you need.
def get_translated_path(self, cr, uid, path, lang, context=None):
if lang == request.lang:
ctx = context.copy()
view = self.pool.get('ir.ui.view')
view_ids = view.search(cr, uid, [('active', '!=', False)], context=context)
for obj in view.browse(cr, uid, view_ids, context=ctx):
if obj.name == path:
return view.browse(cr, uid, obj.id, context=ctx).name
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 11/24/16, 10:29 AM|
|Seen: 771 times|
|Last updated: 9/7/17, 3:47 AM|