【问题标题】:'request.website_multilang' causes AttributeError in Odoo 11'request.website_multilang' 导致 Odoo 11 中的 AttributeError
【发布时间】:2017-12-01 12:11:13
【问题描述】:

我正在将 Odoo 模块从版本 10 迁移到版本 11。我有包含以下代码的网站模板:

<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))">

它引发 AttributeError: 'HttpRequest' 对象没有属性 'website_multilang'。我找不到有关如何将此 Odoo 10 代码改编为 v11 的文档?

【问题讨论】:

    标签: python-3.x openerp odoo-11


    【解决方案1】:

    您可以尝试以下操作:

    <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))">
    

    我刚刚分析过,在v11中它需要是“is_frontend_multilang”而不是“website_multilang”。

    希望它有效。

    问候

    【讨论】:

    • 谢谢,成功了!能否请您告诉您在哪里找到该信息
    • 谢谢@Tchi-Odoo
    猜你喜欢
    • 2022-07-28
    • 2018-12-22
    • 2018-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多