2015-08-18 33 views
3

當我添加到我的模板,我得到以下錯誤Odoo <T T-通話= 「website.layout」> qWebException

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> 
+0

您可以發佈您在此顯示的模板中使用的模型結構的代碼嗎?這將提供更好的想法來確定問題。 –

+0

是http://pastebin.com/GrEUcM4V –

回答

6

的問題是在控制器,我要追加網站= True

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

你知道爲什麼這是必需的嗎? –

相關問題