Odoo Help


What is best practice when translateting a new website module?

Anders Wallenquist
on 10/21/14, 4:49 AM 1,112 views

I have built a new module using a class of the type http.Controller


class website_order(http.Controller):

    @http.route(['/order/list',], type='http', auth="public", website=True)
    def order_list(self, **post):
        cr, uid, context, pool = request.cr, request.uid, request.context, request.registry

        res_user = request.registry.get('sale.order').browse(cr,uid,uid)

        values = {
            'order_menu': 'active',
            'res_user': res_user,
            'sale_orders': request.registry.get('sale.order').browse(cr,uid,request.registry.get('sale.order').search(cr,uid,[('company_id','=',res_user.company_id.id)])),
        return request.website.render("smart_order.list", values)

I have created a i18n-catalogue, a pot and po-file for my translation. The labels and texts that I want to translate are exported to the pot-file and my translation in the po-file are in the database as it supposed to be.

My user have the language int the request.context, but request.website.render does not perform any translation for me. What am I missing?

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/21/14, 4:49 AM
Seen: 1112 times
Last updated: 3/16/15, 8:10 AM