Search code examples
python-3.xodooodoo-11

'request.website_multilang' causes AttributeError in Odoo 11


I'm migrating Odoo module from version 10 to version 11. I have website template with following code:

<ul class="dropdown-menu js_language_selector" t-if="(request and request.website_multilang and len(languages) &gt; 1) or (website and (editable or translatable))">

It raises AttributeError: 'HttpRequest' object has no attribute 'website_multilang'. I can't find documentation on how to adapt this Odoo 10 code to v11?


Solution

  • You can try following :

    <ul class="dropdown-menu js_language_selector" t-if="(request and request.is_frontend_multilang and len(languages) &gt; 1) or (website and (editable or translatable))">
    

    I have just analysed that in v11 it needs to be "is_frontend_multilang" instead of "website_multilang".

    Hope it works.

    Regards