Odoo Help

Fatih Piristine
On 9/6/17, 4:19 PM

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:
return path

ctx = context.copy()
ctx.update({'lang': request.lang})
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:
ctx.update({'lang': lang})
return view.browse(cr, uid, obj.id, context=ctx).name
return path

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 11/24/16, 10:29 AM
Seen: 1140 times
Last updated: 9/7/17, 3:47 AM