Odoo Help

Welcome!

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.

0

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

By
Pascal Tremblay
on 9/26/15, 4:01 PM 796 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

    alert('44444444');

    return;

}

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

Thanks


UPDATE #1

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????

1

Pascal Tremblay

--Pascal Tremblay--
1314
| 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.

@api.cr_uid_ids_context

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

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

engine='website.qweb'

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(

context.copy(),

website=request.website,

url_for=website.url_for,

slug=website.slug,

res_company=company,

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

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

editable=request.website.is_publisher(),

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)

Stats

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