【问题标题】:Odoo <t t-call="website.layout"> qWebExceptionOdoo <t t-call="website.layout"> qWebException
【发布时间】:2015-08-18 03:03:35
【问题描述】:

当我添加到我的模板时,我收到以下错误

QWebException: "'NoneType' object has no attribute 'name'" while evaluating
'res_company.name'

模板代码:

<template id="index" >
        <t t-call="website.layout">
            <t t-set="title">Academy</t>
            <div class="oe_structure">
                <div class="container">
                    <ul><t t-foreach="brands" t-as="b">
                        <li><a t-attf-href="/pa/{{b.id}}">
                            <t t-esc="b.name"/>
                        </a></li>
                    </t></ul>
                </div>
            </div>
        </t>
    </template>

【问题讨论】:

  • 您能否发布您在此所示模板中使用的模型结构的代码?这将为识别问题提供更好的思路。​​

标签: templates web odoo openerp-8


【解决方案1】:

问题出在控制器中,我必须附加网站=True

@http.route('/pa/', auth='public', website=True)

【讨论】:

  • 你知道为什么需要这样做吗?
  • 老而金,你先生是典范
猜你喜欢
  • 1970-01-01
  • 2018-06-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-27
相关资源
最近更新 更多