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

report layout generates error on pdf export but works in preview

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
reportingv15
1 Odpowiedz
5401 Widoki
Awatar
Josef Schmid

I created a custom invoice layout that looks like this

It works fine in the preview

But when I try to generate the pdf from it I only get an html file containing an error

It looks like this:

{"code": 200, "message": "Odoo Server Error", "data": {"name": "odoo.addons.base.models.qweb.QWebException", "debug": "Traceback (most recent call last):\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py\", line 219, in render_template\n yield from compiled_fn(self, values, log)\n File \"\", line 20, in template_205\nAttributeError: 'res.company' object has no attribute 'company_id'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py\", line 2021, in report_download\n response = self.report_routes(reportname, docids=docids, converter=converter, context=context)\n File \"/usr/lib/python3/dist-packages/odoo/http.py\", line 535, in response_wrap\n response = f(*args, **kw)\n File \"/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py\", line 1950, in report_routes\n pdf = report.with_context(context)._render_qweb_pdf(docids, data=data)[0]\n File \"/usr/lib/python3/dist-packages/odoo/addons/account/models/ir_actions_report.py\", line 49, in _render_qweb_pdf\n return super()._render_qweb_pdf(res_ids=res_ids, data=data)\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py\", line 838, in _render_qweb_pdf\n html = self_sudo.with_context(context)._render_qweb_html(res_ids, data=data)[0]\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py\", line 882, in _render_qweb_html\n return self._render_template(self.report_name, data), 'html'\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py\", line 619, in _render_template\n return view_obj._render_template(template, values).encode()\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py\", line 1985, in _render_template\n return self.browse(self.get_view_id(template))._render(values, engine)\n File \"/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_ui_view.py\", line 436, in _render\n return super(View, self)._render(values, engine=engine, minimal_qcontext=minimal_qcontext)\n File \"/usr/lib/python3/dist-packages/odoo/addons/web_editor/models/ir_ui_view.py\", line 29, in _render\n return super(IrUiView, self)._render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py\", line 1993, in _render\n return self.env[engine]._render(self.id, qcontext)\n File \"/usr/lib/python3/dist-packages/odoo/tools/profiler.py\", line 292, in _tracked_method_render\n return method_render(self, template, values, **options)\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py\", line 76, in _render\n result = super()._render(template, values=values, **compile_options)\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py\", line 134, in _render\n result = ''.join(rendering)\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py\", line 221, in render_template\n raise e\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py\", line 219, in render_template\n yield from compiled_fn(self, values, log)\n File \"\", line 52, in template_778\n File \"\", line 48, in t_call_content\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py\", line 221, in render_template\n raise e\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py\", line 219, in render_template\n yield from compiled_fn(self, values, log)\n File \"\", line 926, in template_777\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py\", line 221, in render_template\n raise e\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py\", line 219, in render_template\n yield from compiled_fn(self, values, log)\n File \"\", line 50, in template_208\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py\", line 223, in render_template\n raise QWebException(\"Error when render the template\", self, options,\nodoo.addons.base.models.qweb.QWebException: 'res.company' object has no attribute 'company_id'\nTraceback (most recent call last):\n File \"/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py\", line 219, in render_template\n yield from compiled_fn(self, values, log)\n File \"\", line 20, in template_205\nAttributeError: 'res.company' object has no attribute 'company_id'\n\nError when render the template\nAttributeError: 'res.company' object has no attribute 'company_id'\nTemplate: web.external_layout_boxed\nPath: /t/div[1]/img\nNode: \"report_header\"/\n \n", "message": "Error when render the template", "arguments": ["Error when render the template"], "context": {}}}


As we can read from the error file, the pdf generator is not able to access company.company_id.x_layout_header 

so I changed it to company.x_layout_header

→ Now the Preview doesn't work and the generated pdf looks like this:


Which is also completely wrong, there are no images, the table is not a table, the wrong font etc. What am I doing wrong?

0
Awatar
Odrzuć
Christian Josue Acosta Vargas

Have someone resolved this?

Awatar
Julian L.
Najlepsza odpowiedź


Try this video

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ść
ODOO 15 for "Einnahmenüberschussrechnung EÜR"
reporting v15
Awatar
Awatar
Awatar
2
sie 25
3951
Reports: table headers repeating PO vs SO Rozwiązane
reporting v15
Awatar
Awatar
2
lip 24
6982
Insert image into a report Rozwiązane
reporting v15
Awatar
Awatar
1
kwi 24
2742
Generate and store a pdf or send by mail
pdf reporting v15
Awatar
0
kwi 24
2622
Additional label formats Rozwiązane
reporting labels v15
Awatar
Awatar
1
lut 24
6152
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