Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

qweb Exception

By
Mariano DAngelo
on 8/18/15, 11:09 AM 1,344 views


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.

Emipro Technologies Pvt. Ltd.
on 8/19/15, 1:50 AM

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?

Mariano DAngelo
on 8/19/15, 2:00 AM
0
Mariano DAngelo
On 8/23/15, 12:03 PM

fter lot of reading I discover that controler need website = True


class product_application(http.Controller):

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/18/15, 11:09 AM
Seen: 1344 times
Last updated: 8/23/15, 12:03 PM