Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Unable to print invoice report - odoo 9

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
invoiceprintingodooV9
11 Replies
6414 Tampilan
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
Buang
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
Penulis

Yes, it is defined

Alessandro Romano
Penulis

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
Penulis

No, report_invoice has no inherited views.

I'm on version 9

Alessandro Romano
Penulis

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
Penulis

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

and now the invoice printing is working

Avatar
OpenGest.Solutions
Jawaban Terbai

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
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
SEPA Countries - invoice printing issue
invoice printing SEPA
Avatar
Avatar
2
Sep 22
2461
Print Multiple Invoices Fails Odoo CE 11 Diselesaikan
invoice printing printbutton
Avatar
Avatar
Avatar
4
Apr 22
5482
How to print invoice from POS? - Odoo 8
invoice pos printing
Avatar
Avatar
1
Des 21
6712
invoice print missing customer partner Diselesaikan
invoice printing v11
Avatar
Avatar
Avatar
2
Sep 21
4384
Invoiceable lines option in odoo 9 is not working Diselesaikan
invoice odooV9 v9.0
Avatar
Avatar
6
Feb 24
12742
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik 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