Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

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

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

how to print two existing report with one custom button odoo16?

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
invoiceOdooExperienceNiyasCybrosysodoo16features
1 Antworten
2883 Ansichten
Avatar
waheed

hi odooers
i want to print two pdf reports ( invoice, and delivery report) while clicking on single custom button in odoo 16 e

0
Avatar
Verwerfen
Avatar
Nomadoo
Beste Antwort

To print two existing reports (invoice and delivery report) with a single custom button in Odoo 16, you can create a new button in the user interface and define a server action to handle the logic of generating and printing the reports. Here's a step-by-step guide:

1. Create a Server Action:


    Go to Settings and enable the Developer Mode.

    Navigate to Technical -> Actions -> Server Actions.

    Create a new server action:

        Action Type: ir.actions.server

        Name: Choose a name for your server action.

        Model: Select the model you want to associate the server action with (e.g., Sale Order, Invoice, or any relevant model).

        Execution Context: Current Record


2. Define the Python Code:


In the server action, you need to define Python code that will generate and print the reports. Below is a sample Python code that you can adapt:


python


# Sample Python Code for the server action

invoice_ids = record.invoice_ids.filtered(lambda inv: inv.state == 'posted')

delivery_ids = record.picking_ids.filtered(lambda picking: picking.state == 'done')


# Generate and print the Invoice report

invoice_report = record.env.ref('account.report_invoice').render_qweb_pdf(invoice_ids.ids)

# Save or attach the invoice_report PDF as needed


# Generate and print the Delivery Order report

delivery_report = record.env.ref('stock.report_deliveryorder').render_qweb_pdf(delivery_ids.ids)

# Save or attach the delivery_report PDF as needed


In this code, record represents the current record for which the button is clicked. Adjust the code according to your specific model and logic.

3. Create a New Button:


    Navigate to the model for which you want to add the button (e.g., Sale Order, Invoice, or any relevant model).


    In the model's form view, add a new button to trigger the server action.


    xml


   


    Replace your_server_action_name with the actual name of your server action.


4. Adjust Security Settings:


Make sure that the user or user group has the necessary access rights to execute the server action and access the reports.

5. Test:


Test the button by navigating to a record of the associated model and clicking on the newly created button. Verify that both reports (invoice and delivery) are generated and printed as expected.

0
Avatar
Verwerfen
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
add search panel in graph and pivot view in odoo 16
Niyas Cybrosys odoo16features
Avatar
Avatar
1
Dez. 23
1945
Unlink my Subscription from odoo online and link to odoo.sh
odoo Niyas Cybrosys odoo16features
Avatar
Avatar
1
Okt. 24
4698
parent company process sale orders of it's child company in point of sale Gelöst
community Niyas Cybrosys odoo16features
Avatar
Avatar
1
Apr. 24
1949
RPC_ERROR Odoo Server Error
employee Niyas Cybrosys odoo16features
Avatar
Avatar
Avatar
2
Feb. 24
2696
allow portal user to view custom model backend view using sharing via odoo 16 portal
odoo Niyas Cybrosys odoo16features
Avatar
0
Dez. 23
2351
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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