Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

How to Create Custom Invoice PDF Report with Odoo Module

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
modulesinvoicereportingpdfreport
1 Beantwoorden
7887 Weergaven
Avatar
headkit

I'm looking to generate a customized PDF report for invoices. I've successfully created a similar report for quotes 8and also for invoices within Flectra), but I'm facing some challenges when it comes to invoices.

Could someone kindly guide me on the step-by-step process of creating a custom Invoice PDF report using a module in Odoo 17? I'm particularly interested in understanding the necessary configurations, QWeb templates, and any other relevant details that would help me achieve this.

I want to understand what's the difference in concept bewteen sales order/quote and invoices.

Thnx!

-1
Avatar
Annuleer
headkit
Auteur

In Flectra I had to add a template file with

<template id="report_aime_invoice" inherit_id="account.report_invoice_document">

where I then replaced the PAGE section with

<xpath expr="//div[hasclass('page')]" position="replace">

Avatar
Mily Shajan
Beste antwoord

Hi 

You can create a report action for the account.move as the model and binding model, and then update the proper template with style and fields.

Create PDF Report in Odoo 17 

PDF Report


Regards

0
Avatar
Annuleer
headkit
Auteur

Thank you for your answer, but it just explains how to add a custom report, ie. for products. In my case I want to override the invoice report and for that I need direct instructions about how to register the record (from my understanding), like
<record id="custom_invoice_layout" model="ir.actions.report">...
or how to register my qweb template file
<template id="invoice_layout_custom">...

headkit
Auteur

from your suggestion it would be something like

<record id="custom_invoice_layout" model="ir.actions.report">
<field name="name">Custom Invoice Layout</field>
<field name="model">account.move</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">custom_odoo_templates.invoice_layout_custom</field>
<field name="report_file">custom_odoo_templates.invoice_layout_custom</field>
<field name="report_file">account.report_invoice</field>
<!-- <field name="print_report_name">'Invoice_%s' % (object.name)</field> -->
<field name="binding_model_id" ref="account.model_account_move"/>
<field name="binding_type">report</field>
</record>

headkit
Auteur

if I use that, I get the error
odoo.addons.base.models.ir_qweb.QWebException: Error while render the template
KeyError: 'doc'
Template: custom_odoo_templates.quote_layout_custom

so for me it looks like the invoice report is being rendered using the (overridden) quote (sale.order) template.

headkit
Auteur

I now deleted the <record> and just work with
<template id="invoice_layout_custom" inherit_id="account.report_invoice_with_payments">
I also added t-if="doc" everywhere in the <template id="quote_layout_custom"> tags and it now looks like the rendering reaches the default invoice templat as I now get the KeyError
KeyError: 'o'
Template: account.report_invoice_with_payments
Questions arise like: Why does it renders the sale order template before? And why is there no o-Object any more?

Mily Shajan

If you need to create a new invoice report try this <record id="action_invoice_report" model="ir.actions.report">
<field name="name">Invoice Report</field>
<field name="model">account.move</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">invoice_report.report_invoice_template</field>
<field name="report_file">invoice_report.report_invoice_template</field>
<field name="print_report_name">'Report - %s' % (object.name)</field>
<field name="binding_model_id" ref="account.model_account_move"/>
<field name="binding_type">report</field>
</record>

otherwise, if you need to inherit the default invoice report and make changes use inherit_id and call this template account.report_invoice_document
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
inside you can add the updates
</template>

headkit
Auteur

trying to inherit the default invoice report with

<record id="custom_invoice_layout" model="ir.actions.report">
<field name="name">Custom Invoice Layout</field>
<field name="model">account.move</field>
<field name="inherit_id">custom_odoo_templates.invoice_layout_custom</field>
</record>

I get the error

ValueError: Invalid field 'inherit_id' on model 'ir.actions.report'

Mily Shajan

inherit_id is in the report template, not in ir.actions_report model

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Where can I download the simplest module with an RML report?
modules reporting
Avatar
Avatar
Avatar
2
mrt. 15
4576
Displaying the conversion rate on the invoice report
accounting invoice reporting
Avatar
0
jan. 25
1968
Printed Offers and Reports are missing the headers and footers Opgelost
invoice reporting v15
Avatar
Avatar
Avatar
Avatar
4
jul. 23
8702
How to view detailed payment reports for invoices
invoice reporting Reports
Avatar
0
jun. 23
2536
Odoo Down payment show the individual products instead of just down payment
invoice reporting v15
Avatar
Avatar
1
mrt. 25
3061
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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