Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all IndustriesInauguration Odoo Lyon
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Error Printing QWeb Reports

Subscribe

Get notified when there's activity on this post

This question has been flagged
templatesportalsale.ordersales.orderQWebException
1 Reply
10306 Views
Avatar
Marcel Harris

Hello all, I have scoured the forums and the web for 4 days looking for a solution and so far none. I cannot print any QWeb reports (Quotation or Invoice are the ones I've tried).

I CAN print PDF reports in accounting, it only fails when I use a window action to print something. I confirmed that wkhtmltopdf is working. 

Here's what I've tried so far: 

  • Updated web.base.url to use the https desgination 

  • Added web.base.url.freeze and added true value

  • Added report.url parameter with value http://0.0.0.0:8069

  • Uninstalled and reinstalled modules

  • Looked in the database to see if the actions got screwed up (can't figure out why it is looking for the backend template for sale.sale_order_portal_template  even when I try to print an invoice

  • Validated that the template exists and it is untouched from the installation according to what is on github.

  • Validated that the same error occurs when viewing in html. 

About the environment: I am running this on AWS using Ubuntu 18.04 and also using nginx to reroute from 8069 to 80 and also for SSL. I don't know much about python so I have not modified any of the .py files. 

Thank you for reading and I hope that someone out there has a solution. 

Error:

Odoo Server Error


Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 332, in _compiled_fn

    return compiled(self, append, new, options, log)

  File "<template>", line 1, in template_sale_sale_order_portal_template_357

  File "<template>", line 2, in body_call_content_355

  File "<template>", line 5, in set_315

  File "<template>", line 6, in body_call_content_313

AttributeError: 'NoneType' object has no attribute '_name'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 2023, in report_download

    response = self.report_routes(reportname, docids=docids, converter=converter, context=context)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap

    response = f(*args, **kw)

  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1961, in report_routes

    pdf = report.with_context(context).render_qweb_pdf(docids, data=data)[0]

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 727, in render_qweb_pdf

    html = self.with_context(context).render_qweb_html(res_ids, data=data)[0]

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 767, in render_qweb_html

    return self.render_template(self.report_name, data), 'html'

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 541, in render_template

    return view_obj.render_template(template, values)

  File "/usr/lib/python3/dist-packages/odoo/addons/web_window_title/models/ir_ui_view.py", line 18, in render_template

    return super(View, self).render_template(template, values=values, engine=engine)

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 1174, in render_template

    return self.browse(self.get_view_id(template)).render(values, engine)

  File "/usr/lib/python3/dist-packages/odoo/addons/web_editor/models/ir_ui_view.py", line 25, in render

    return super(IrUiView, self).render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 1182, in render

    return self.env[engine].render(self.id, qcontext)

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 58, in render

    result = super(IrQWeb, self).render(id_or_xml_id, values=values, **context)

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 260, in render

    self.compile(template, options)(self, body.append, values or {})

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 334, in _compiled_fn

    raise e

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 332, in _compiled_fn

    return compiled(self, append, new, options, log)

  File "<template>", line 1, in template_sale_report_saleorder_227

  File "<template>", line 2, in body_call_content_225

  File "<template>", line 3, in foreach_224

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 334, in _compiled_fn

    raise e

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 332, in _compiled_fn

    return compiled(self, append, new, options, log)

  File "<template>", line 1, in template_sale_report_saleorder_document_277

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 334, in _compiled_fn

    raise e

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 332, in _compiled_fn

    return compiled(self, append, new, options, log)

  File "<template>", line 1, in template_web_external_layout_308

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 339, in _compiled_fn

    raise QWebException("Error to render compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name)

odoo.addons.base.models.qweb.QWebException: 'NoneType' object has no attribute '_name'

Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 332, in _compiled_fn

    return compiled(self, append, new, options, log)

  File "<template>", line 1, in template_sale_sale_order_portal_template_357

  File "<template>", line 2, in body_call_content_355

  File "<template>", line 5, in set_315

  File "<template>", line 6, in body_call_content_313

AttributeError: 'NoneType' object has no attribute '_name'


Error to render compiling AST

AttributeError: 'NoneType' object has no attribute '_name'

Template: sale.sale_order_portal_template

Path: /t/t/body/div[1]/t/t/t

Node: <t t-set="backend_url" t-value="'/web#model=%s&amp;id=%s&amp;action=%s&amp;view_type=form' % (sale_order._name, sale_order.id, action.id)"/>

0
Avatar
Discard
Avatar
Marcel Harris
Author Best Answer

Hi all.. I was able to solve this myself. Adding an answer to help the next person. 

On the settings where I was modifying views (before I found the Technical Menu) there is a dropdown in Business Documents - Document Layout. Be sure that box is clear and then press save. If that dropdown has anything in it, then all qweb reports will try to use that document. 

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Error While Printing Sales Order quotation Solved
templates sales.order
Avatar
Avatar
1
Mar 20
5394
Create Project from a template when Sales Order is created Solved
templates projects sales.order
Avatar
Avatar
Avatar
Avatar
Avatar
5
Nov 25
23341
Sending template sale order to several customers
templates sale.order emailing
Avatar
Avatar
1
May 24
2413
qweb Exception Solved
qweb templates QWebException
Avatar
4
Aug 20
10757
Add custom module in portal
templates portal odoo12
Avatar
0
Nov 19
7537
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now