Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

Unable to print invoice report - odoo 9

Subscribe

Get notified when there's activity on this post

This question has been flagged
invoiceprintingodooV9
11 Replies
6407 Views
Avatar
Alessandro Romano

When I try to print an invoice I get the following

the complete traceback is :

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/openerp/addons/report/controllers/main.py", line 101, in report_download
    response = self.report_routes(reportname, docids=docids, converter='pdf')
  File "/usr/lib/python2.7/site-packages/openerp/http.py", line 509, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python2.7/site-packages/openerp/addons/report/controllers/main.py", line 45, in report_routes
    pdf = report_obj.get_pdf(cr, uid, docids, reportname, data=data, context=context)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/report/models/report.py", line 156, in get_pdf
    html = self.get_html(cr, uid, ids, report_name, data=data, context=context)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/report/models/report.py", line 130, in get_html
    return self.render(cr, uid, [], report.report_name, docargs, context=context)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/report/models/report.py", line 106, in render
    return view_obj.render(cr, uid, template, values, context=context)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/web_editor/models/ir_ui_view.py", line 29, in render
    return super(view, self).render(cr, uid, id_or_xml_id, values=values, engine=engine, context=context)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_ui_view.py", line 1070, in render
    return self.pool[engine].render(cr, uid, id_or_xml_id, qcontext, loader=loader, context=context)
  File "/usr/lib/python2.7/site-packages/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 254, in render
    return self.render_node(element, qwebcontext, generated_attributes=qwebcontext.pop('generated_attributes', ''))
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node
    result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element
    generated_attributes= name == "t" and generated_attributes or ''))
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 295, in render_node
    result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext)
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 448, in render_tag_call
    d[0] = self.render_element(element, template_attributes, generated_attributes, d)
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element
    generated_attributes= name == "t" and generated_attributes or ''))
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 295, in render_node
    result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext)
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 485, in render_tag_set
    qwebcontext[template_attributes["set"]] = self.eval_object(template_attributes["value"], qwebcontext)
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 198, in eval_object
    return self.eval(expr, qwebcontext)
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 195, in eval
    raise_qweb_exception(message="Could not evaluate expression %r" % expr, expression=expr, template=template)
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 192, in eval
    return qwebcontext.safe_eval(expr)
  File "/usr/lib/python2.7/site-packages/openerp/addons/base/ir/ir_qweb.py", line 104, in safe_eval
    return eval(expr, None, locals_dict, nocopy=True, locals_builtins=True)
  File "/usr/lib/python2.7/site-packages/openerp/tools/safe_eval.py", line 298, in safe_eval
    return eval(c, globals_dict, locals_dict)
  File "", line 1, in <module>
QWebException: "'NoneType' object has no attribute 'with_context'" while evaluating
"o.with_context({'lang':o.partner_id.lang})"
0
Avatar
Discard
OpenGest.Solutions

If you go to the Customer page If you go to the Customer page , he has a laguage defined? http://prntscr.com/c1j6tj

Alessandro Romano
Author

Yes, it is defined

Alessandro Romano
Author

If I change invoice template to default "account.report_invoice" I get this error:

Traceback (most recent call last):

File "/usr/lib/python2.7/site-packages/openerp/addons/report/controllers/main.py", line 101, in report_download

response = self.report_routes(reportname, docids=docids, converter='pdf')

File "/usr/lib/python2.7/site-packages/openerp/http.py", line 509, in response_wrap

response = f(*args, **kw)

File "/usr/lib/python2.7/site-packages/openerp/addons/report/controllers/main.py", line 45, in report_routes

pdf = report_obj.get_pdf(cr, uid, docids, reportname, data=data, context=context)

File "/usr/lib/python2.7/site-packages/openerp/api.py", line 250, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/site-packages/openerp/addons/report/models/report.py", line 170, in get_pdf

save_in_attachment = self._check_attachment_use(cr, uid, ids, report)

File "/usr/lib/python2.7/site-packages/openerp/api.py", line 250, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/site-packages/openerp/addons/report/models/report.py", line 311, in _check_attachment_use

pdf = base64.decodestring(pdf)

File "/usr/lib64/python2.7/base64.py", line 321, in decodestring

return binascii.a2b_base64(s)

TypeError: must be string or buffer, not None

OpenGest.Solutions

Ok. If you go to Settings > User Interface > Views

(if in odoov9, you should activate the developer mode: http://www.opengest.solutions/blog/nouveautes-numeriques-1/post/comment-activer-le-mode-developpeur-sur-odoo-7)

Make a search: report_invoice

You should have 2 views: report_invoice and report_invoice_document

Can you post their content?

Are you working in odoov8 or odoov9?

OpenGest.Solutions

And let me know if the report_invoice view has inherited views...

Alessandro Romano
Author

No, report_invoice has no inherited views.

I'm on version 9

Alessandro Romano
Author

report_invoice view:

<?xml version="1.0"?>

<t t-name="account.report_invoice">

<t t-call="report.html_container">

<t t-foreach="docs" t-as="o">

<t t-call="account.report_invoice_document" t-lang="o.partner_id.lang"/>

</t>

</t>

</t>

----------------------------------------

report_invoice_document view --->

<?xml version="1.0"?>

<t t-name="account.report_invoice_document">

<t t-call="report.external_layout">

<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/>

<div class="page">

<div class="row">

<div class="col-xs-5 col-xs-offset-7">

<address t-field="o.partner_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}"/>

<span t-if="o.partner_id.vat">TIN: <span t-field="o.partner_id.vat"/></span>

</div>

</div>

<h2>

<span t-if="o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">Invoice</span>

<span t-if="o.type == 'out_invoice' and o.state == 'proforma2'">PRO-FORMA</span>

<span t-if="o.type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>

<span t-if="o.type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>

<span t-if="o.type == 'out_refund'">Refund</span>

<span t-if="o.type == 'in_refund'">Vendor Refund</span>

<span t-if="o.type == 'in_invoice'">Vendor Bill</span>

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

</h2>

<div class="row mt32 mb32">

<div class="col-xs-2" t-if="o.name">

<strong>Description:</strong>

<p t-field="o.name"/>

</div>

<div class="col-xs-2" t-if="o.date_invoice">

<strong>Invoice Date:</strong>

<p t-field="o.date_invoice"/>

</div>

<div class="col-xs-2" t-if="o.date_due and o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">

<strong>Due Date:</strong>

<p t-field="o.date_due"/>

</div>

<div class="col-xs-2" t-if="o.origin">

<strong>Source:</strong>

<p t-field="o.origin"/>

</div>

<div class="col-xs-2" t-if="o.partner_id.ref">

<strong>Customer Code:</strong>

<p t-field="o.partner_id.ref"/>

</div>

<div name="reference" class="col-xs-2" t-if="o.reference">

<strong>Reference:</strong>

<p t-field="o.reference"/>

</div>

</div>

<!-- Is there a discount on at least one line? -->

<t t-set="display_discount" t-value="any([l.discount for l in o.invoice_line_ids])"/>

<table class="table table-condensed">

<thead>

<tr>

<th>Description</th>

<th class="text-right">Quantity</th>

<th class="text-right">Unit Price</th>

<th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">Disc.(%)</th>

<th class="text-right">Taxes</th>

<th class="text-right">Price</th>

</tr>

</thead>

<tbody class="invoice_tbody">

<tr t-foreach="o.invoice_line_ids" t-as="l">

<td><span t-field="l.name"/></td>

<td class="text-right">

<span t-field="l.quantity"/>

<span t-field="l.uom_id" groups="product.group_uom"/>

</td>

<td class="text-right">

<span t-field="l.price_unit"/>

</td>

<td t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">

<span t-field="l.discount"/>

</td>

<td>

<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.invoice_line_tax_ids))"/>

</td>

<td class="text-right">

<span t-field="l.price_subtotal" t-field-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;o.currency_id&quot;}"/>

</td>

</tr>

</tbody>

</table>

<div class="row">

<div class="col-xs-4 pull-right">

<table class="table table-condensed">

<tr class="border-black">

<td><strong>Subtotal</strong></td>

<td class="text-right">

<span t-field="o.amount_untaxed" t-field-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;o.currency_id&quot;}"/>

</td>

</tr>

<t t-foreach="o._get_tax_amount_by_group()" t-as="amount_by_group">

<tr>

<td><span t-esc="amount_by_group[0]"/></td>

<td class="text-right">

<span t-esc="amount_by_group[1]"/>

</td>

</tr>

</t>

<tr class="border-black">

<td><strong>Total</strong></td>

<td class="text-right">

<span t-field="o.amount_total" t-field-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;o.currency_id&quot;}"/>

</td>

</tr>

</table>

</div>

</div>

<div class="row" t-if="o.tax_line_ids">

<div class="col-xs-6">

<table class="table table-condensed">

<thead>

<tr>

<th>Tax</th>

<th class="text-right">Amount</th>

</tr>

</thead>

<tbody>

<tr t-foreach="o.tax_line_ids" t-as="t">

<td><span t-field="t.name"/></td>

<td class="text-right">

<span t-field="t.amount" t-field-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;o.currency_id&quot;}"/>

</td>

</tr>

</tbody>

</table>

</div>

</div>

<p t-if="o.comment">

<strong>Comment:</strong>

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

</p>

<p t-if="o.payment_term_id">

<span t-field="o.payment_term_id.note"/>

</p>

<p t-if="o.fiscal_position_id.note">

<strong>Fiscal Position Remark:</strong>

<span t-field="o.fiscal_position_id.note"/>

</p>

</div>

<p>Preservativi, test di gravidanza, cerotti, dental dams e test di ovulazione sono dispositivi medici conformi alle direttive europee 93/42/CEE, 90/385/CEE e 98/79/CE</p>

</t>

</t>

OpenGest.Solutions

Everything seems correct... you only have problems when printing invoices? if you try to print a sales order, it works?

OpenGest.Solutions

If yes, try to uncheck the "Reload from attachment" in Settings > Reports > Reports for Invoices

You said: If I change invoice template to default "account.report_invoice" I get this error...

so you have several invoice reports... no problem, but you should have 2 views for that report:

1 for the report similar to this one: http://gitlab.opengest.fr/opengest/odoo/blob/master/addons/account/views/report_invoice.xml#L136

and you can call him my_report_invoice

and change this line:

<t t-call="your_module.my_report_invoice_document" t-lang="o.partner_id.lang"/>

Another view similar to this one:

http://gitlab.opengest.fr/opengest/odoo/blob/master/addons/account/views/report_invoice.xml#L4

And you have to change is id to my_report_invoice_document

I think that the source of the problem is that you have tried to create a new report invoice, customized, with just one view...

Alessandro Romano
Author

Thanks! I unchecked "Reload from attachment" in Settings > Reports > Reports for Invoices

and now the invoice printing is working

Avatar
OpenGest.Solutions
Best Answer

Try to uncheck the "Reload from attachment" in Settings > Reports > Reports for Invoices

You said: If I change invoice template to default "account.report_invoice" I get this error...

so you have several invoice reports... no problem, but you should have 2 views for that report:

1 for the report similar to this one: http://gitlab.opengest.fr/opengest/odoo/blob/master/addons/account/views/report_invoice.xml#L136

and you can call him my_report_invoice

and change this line:

<t t-call="your_module.my_report_invoice_document" t-lang="o.partner_id.lang"/>

Another view similar to this one:

http://gitlab.opengest.fr/opengest/odoo/blob/master/addons/account/views/report_invoice.xml#L4

And you have to change is id to my_report_invoice_document

I think that the source of the problem is that you have tried to create a new report invoice, customized, with just one view...

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
SEPA Countries - invoice printing issue
invoice printing SEPA
Avatar
Avatar
2
सित॰ 22
2459
Print Multiple Invoices Fails Odoo CE 11 Solved
invoice printing printbutton
Avatar
Avatar
Avatar
4
अप्रैल 22
5476
How to print invoice from POS? - Odoo 8
invoice pos printing
Avatar
Avatar
1
दिस॰ 21
6705
invoice print missing customer partner Solved
invoice printing v11
Avatar
Avatar
Avatar
2
सित॰ 21
4384
Invoiceable lines option in odoo 9 is not working Solved
invoice odooV9 v9.0
Avatar
Avatar
6
फ़र॰ 24
12736
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة 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 ภาษาไทย Türkçe українська Tiếng Việt

Odoo, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

Odoo की सबसे बड़ी खासियत है कि यह इस्तेमाल करने में बहुत आसान है और यह पूरी तरह से इंटिग्रेट किया हुआ है.

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