Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Change PDF report name on wizard

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
wizardreport
2 Răspunsuri
4088 Vizualizări
Imagine profil
Arthur LEHAVRE

I'm using Odoo 17 and I added a custom button on the project form view that displays wizard view to recap some informations and then export them inside a PDF report. Everything works fine except one thing : I can't change the name of the PDF. 

When I don't generate the report through the native print button instead, in the project model, the field   works fine. But through a custom button, it doesn't, it keeps using the field  .

Any idea about how to change report file name through wizard?

Thanks a lot

Here is my code :


   
       My Custom PDF
       report.custom_module.my_report
       qweb-pdf
       custom_module.my_report
       custom_module.my_report
       'the name of the file'
       report
   
/
0
Imagine profil
Abandonează
Imagine profil
Arthur LEHAVRE
Autor Cel mai bun răspuns

Thanks a lot for your answer. Unfortunatly, I still have the issue. The report file name use the string instead of print_report_name. It drives me mad ! 

0
Imagine profil
Abandonează
Imagine profil
Jainesh Shah(Aktiv Software)
Cel mai bun răspuns

Hello Arthur LEHAVRE ,


To change the name of the PDF generated by your custom button in Odoo 17, you need to ensure that the filename is dynamically set in your report action. Here’s a step-by-step guide on how to achieve this:


1. Define the report action:

//Code 1 in Comment//


2. Modify the wizard to generate the report:


Ensure your wizard calls the report action with the context needed to set the filename.

//Code 2 in Comment//


3. Adjust the button in the form view to call the wizard:

   

Make sure your button in the project form view calls the wizard action.

//Code 3 in Comment//


4. Ensure the wizard action is defined:

   

Make sure your wizard action is correctly defined in the XML file.

//Code 4 in Comment//


Hope this helps.

   

If you need any help in customisation feel free to contact us.

       

Thanks & Regards,

Email:  odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari

0
Imagine profil
Abandonează
Jainesh Shah(Aktiv Software)

Code 1:

<report
id="my_custom_report"
model="project.project"
string="My Custom PDF"
report_type="qweb-pdf"
name="custom_module.my_report"
file="custom_module.my_report"
print_report_name="(object.name or 'report_name') + '_Report'"
/>

Code 2 :

class MyCustomWizard(models. TransientModel):
_name = 'custom_module.my_custom_wizard'
_description = 'Custom Wizard for PDF Report'

def action_generate_report(self):
return self.env.ref('custom_module.my_custom_report').report_action(self)

Code 3:

<record id="view_project_form" model="ir.ui.view">
<field name="name">project.form</field>
<field name="model">project.project</field>
<field name="arch" type="xml">
<form string="Project">
<!-- Your existing form view structure -->
<button name="action_generate_report" type="object" string="Generate PDF" class="btn-primary"/>
<!-- Your existing form view structure -->
</form>
</field>
</record>

Code 4:

<record id="action_my_custom_wizard" model="ir.actions.act_window">
<field name="name">My Custom Wizard</field>
<field name="res_model">custom_module.my_custom_wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Blank report PDF from Wizard Rezolvat
wizard report
Imagine profil
Imagine profil
2
apr. 24
3624
External ID not found in the system
wizard report
Imagine profil
4
oct. 20
6530
How to print report without closing wizard?
wizard report
Imagine profil
Imagine profil
1
mar. 15
6072
How to generate a report from a wizard?
wizard reporting report
Imagine profil
Imagine profil
1
apr. 24
33087
Close wizard after print report Rezolvat
wizard report odooV8
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
feb. 24
13520
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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