Powermax1990
Powermax1990

Reputation: 13

Odoo 8 QWEB / Create custom Report / QWebException Error

i work currently on a custom report on odoo 8 (self hosted) and created a report structure based on this tutorial: http://odoo.guide/report-design-workshop/

generally the template is created well but when I start zu use e.g.

<span t-field="o.partner_id"/>

The pdf-print crashes and returns an gigantic error text. The last sentence tells me something about, so far I understood this, that the connection between invoice and template is not available.

QWebException: 'NoneType' object has no attribute '_fields'

Im not sure where this error comes from and how i could fix it :/ Hope you can help me

Upvotes: 0

Views: 744

Answers (1)

DASADIYA CHAITANYA
DASADIYA CHAITANYA

Reputation: 2892

Basically You should follow the below way :

1. Check to print your returned value of o (obejct) using Qweb template rendering.

<span t-esc="o" />

2. Based on point 1 the o will return the particular module so that you can easily

3. You can easily choeck from that module having the partner_id field for it or not . If it is exist into that model then you can easily access as

<span t-field="o.partner_id"/>

using Qweb Template Rendering.

4. If you have any field which are currently exist within that object then you must have to check weather the field is exist or not and then after you can print it in your Template File.

<t t-if="o.partner_id">
     <span t-field="o.partner_id.name" />
</t>

In Your case field is not even present into your module so that this kind of issue will arise from your side.

please check as follow above steps and your problem will definitely resolved.

I hope my answer may helpful for you :)

Upvotes: 0

Related Questions