Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Unable to print invoice report - odoo 9

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
invoiceprintingodooV9
11 Răspunsuri
6420 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
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
Autor

Yes, it is defined

Alessandro Romano
Autor

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
Autor

No, report_invoice has no inherited views.

I'm on version 9

Alessandro Romano
Autor

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
Autor

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

and now the invoice printing is working

Imagine profil
OpenGest.Solutions
Cel mai bun răspuns

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
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
SEPA Countries - invoice printing issue
invoice printing SEPA
Imagine profil
Imagine profil
2
sept. 22
2463
Print Multiple Invoices Fails Odoo CE 11 Rezolvat
invoice printing printbutton
Imagine profil
Imagine profil
Imagine profil
4
apr. 22
5487
How to print invoice from POS? - Odoo 8
invoice pos printing
Imagine profil
Imagine profil
1
dec. 21
6722
invoice print missing customer partner Rezolvat
invoice printing v11
Imagine profil
Imagine profil
Imagine profil
2
sept. 21
4387
Invoiceable lines option in odoo 9 is not working Rezolvat
invoice odooV9 v9.0
Imagine profil
Imagine profil
6
feb. 24
12746
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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