Odoo Help


This community 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.


How to get openerp.website.translatable true????

Pascal Tremblay
on 9/26/15, 4:01 PM 784 views

Hello all,

In the file /static/src/js/website.translator.js, we have the code :

if (!openerp.website.translatable) {

    // Temporary hack until the editor bar is moved to the web client




For one of my website, openerp.website.translatable is FALSE. Where is taken this value? How to change it to TRUE?



Ok, I now know that this value is taken here :

    <template id="website_lapagept.website_layout_pt" name="Main layout - PT">&lt;!DOCTYPE html&gt;

        <html t-att-lang="lang and lang.replace('_', '-')"

            t-att-data-website-id="website.id if editable and website else None"

            t-att-data-editable="'1' if editable else None"

            t-att-data-translatable="'1' if translatable else None"


But now, where does this new « translatable » take his value????


Pascal Tremblay

--Pascal Tremblay--
| 5 2 7
Alma, Canada
--Pascal Tremblay--

Pascal Tremblay
On 9/26/15, 8:14 PM

In the file : odoo-8.0-20150920/openerp/addons/website/models/ir_ui_view.py

This is where the real value of translatable is given.


def render(self, cr, uid, id_or_xml_id, values=None, engine='ir.qweb', context=None):

if request and getattr(request, 'website_enabled', False):


if isinstance(id_or_xml_id, list):

id_or_xml_id = id_or_xml_id[0]

if not context:

context = {}

company = self.pool['res.company'].browse(cr, SUPERUSER_ID, request.website.company_id.id, context=context)

qcontext = dict(






user_id=self.pool.get("res.users").browse(cr, uid, uid),

translatable=context.get('lang') != request.website.default_lang_code,


menu_data=self.pool['ir.ui.menu'].load_menus_root(cr, uid, context=context) if request.website.is_user() else None,

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

1 follower(s)


Asked: 9/26/15, 4:01 PM
Seen: 784 times
Last updated: 9/27/15, 7:38 AM