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

2.4k views Asked by At

I used Odoo 9 on windows 10 with PostgreSQL, and I installed a module to add the amount on letter. When I try to print the devise of sales, it shows this error :

Odoo Server Error

Traceback (most recent call last):
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\report\controllers\main.py", line 96, in report_download
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\.\openerp\http.py", line 514, in response_wrap
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\report\controllers\main.py", line 45, in report_routes
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\report\models\report.py", line 181, in get_pdf
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\report\models\report.py", line 147, in get_html
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\report\models\report.py", line 123, in render
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\web_editor\models\ir_ui_view.py", line 29, in render
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_ui_view.py", line 1081, in render
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 254, in render
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 297, in render_node
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 320, in render_element
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 295, in render_node
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 448, in render_tag_call
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 320, in render_element
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 295, in render_node
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 426, in render_tag_foreach
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 320, in render_element
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 295, in render_node
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 459, in render_tag_call
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 254, in render
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 297, in render_node
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 320, in render_element
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 295, in render_node
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 448, in render_tag_call
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 320, in render_element
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 297, in render_node
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 320, in render_element
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 297, in render_node
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 320, in render_element
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 297, in render_node
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 325, in render_element
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 320, in render_element
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 295, in render_node
      File "C:\Program Files (x86)\Odoo 9.0-20161116\server\openerp\addons\base\ir\ir_qweb.py", line 503, in render_tag_field
    QWebException: 'NoneType' object has no attribute '_fields'

The module is: ap_object_amount_text

2

There are 2 answers

0
Chandni On

Have u tried by adding this line in the top of your PY file:

from openerp import models, fields, api, _

And are you facing any other error from UI?

Let me know if it is working.

Thanks, Chandni.

0
Shikhar Sharma On

This is related to qweb exception raised when you try printing that field which does not exist in the model.

try searching tags with t-field attribute and try to figure out whether the fields mentioned in t-field do exist in the model or not.

Thanks