我将Odoo模块从版本10迁移到版本11.我的网站模板包含以下代码:
<ul class="dropdown-menu js_language_selector" t-if="(request and request.website_multilang and len(languages) > 1) or (website and (editable or translatable))">
它引发了AttributeError:&#39; HttpRequest&#39;对象没有属性&#39; website_multilang&#39;。我找不到关于如何将这个Odoo 10代码改编为v11的文档?
答案 0 :(得分:3)
您可以尝试以下操作:
<ul class="dropdown-menu js_language_selector" t-if="(request and request.is_frontend_multilang and len(languages) > 1) or (website and (editable or translatable))">
我刚刚分析了在v11中它需要是“is_frontend_multilang”而不是“website_multilang”。
希望它有效。
此致