When I add website.layout to my templates I get the following error
QWebException: "'NoneType' object has no attribute 'name'" while evaluating
'res_company.name'
the template code:
<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>from openerp import fields, models
class Brand(models.Model):
_name = 'product_application.brand'
name = fields.Char()
models_ids = fields.One2many('product_application.model', 'brand_id', string="Models")
class Model(models.Model):
_name = 'product_application.model'
name = fields.Char()
brand_id = fields.Many2one('product_application.brand', string="Brand")
versions_ids = fields.One2many('product_application.version', 'model_id', string="Versions")
class Version(models.Model):
_name='product_application.version'
name = fields.Char()
model_id = fields.Many2one('product_application.model',string="Model")
Here res_company is object of the res.company model. But, any how it is not set inside your template. There are so many reasons that res_company having "none" i.e. access rights issue, dependancy issue etc... Can you explain more on your error ? Thanks.
I can't explain more the error becouse I'm new in odoo, what do you need to debug? I don't put any reference to company object, why is asking for it?
Solution: https://learnopenerp.blogspot.com/2020/08/t-call-web-website-login-layout-qwebexception-odoo.html