Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Unable to print invoice report - odoo 9

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
invoiceprintingodooV9
11 Odpowiedzi
6404 Widoki
Awatar
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
Awatar
Odrzuć
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

Awatar
OpenGest.Solutions
Najlepsza odpowiedź

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
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
SEPA Countries - invoice printing issue
invoice printing SEPA
Awatar
Awatar
2
wrz 22
2458
Print Multiple Invoices Fails Odoo CE 11 Rozwiązane
invoice printing printbutton
Awatar
Awatar
Awatar
4
kwi 22
5475
How to print invoice from POS? - Odoo 8
invoice pos printing
Awatar
Awatar
1
gru 21
6701
invoice print missing customer partner Rozwiązane
invoice printing v11
Awatar
Awatar
Awatar
2
wrz 21
4384
Invoiceable lines option in odoo 9 is not working Rozwiązane
invoice odooV9 v9.0
Awatar
Awatar
6
lut 24
12733
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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