Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3806 Weergaven

Hello! I need a big help.

I need to change the report filename when the pdf is downloaded. 

If i use the "Print" button it works correctly, but if i use a custom button it not works.

Everytime the file is downloaded, it has the name "Generate Report.pdf" 

How to solve this problem? (Check the comment)

Thank you

Avatar
Annuleer
Auteur

<record id="action_generate_report" model="ir.actions.report">
<field name="name">Generate Report</field>
<field name="model">custome.module</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">module.generate_report_template</field>
<field name="report_file">module.generate_report_template</field>
<field name="print_report_name">"Report - %s" % self.name</field>
<field name="paperformat_id" ref="paperformat_margin" />
</record>

Hi Angelo did you find any solution ?
I am having the same issue.

Beste antwoord

Hi 
You can refer to the pdf creation in odoo14
https://www.cybrosys.com/blog/how-to-create-pdf-report-odoo-14

OR 
you can try this code

<record id="action_generate_report" model="ir.actions.report">
 
        <field name="name">Generate Report</field>
          <field name="model">custome.module</field>
          <field name="report_type">qweb-pdf</field>
          <field name="report_name">module.generate_report_template</field>
          <field name="report_file">module.generate_report_template</field>
          <field name="print_report_name">"Report - %s" % object.name</field>
          <field name="paperformat_id" ref="paperformat_margin" />
          <field name="binding_model_id" ref="model_custom_module"/>
          <field name="binding_type">report</field>
</record>



Hope it helps
Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
7
apr. 23
27883
1
jan. 24
1508
1
apr. 22
9156
1
nov. 21
5705
3
mrt. 21
11748