Skip to Content
Menu
This question has been flagged

Hi,

I am creating a new report via XML in a module

 <report
id="report_invoice_custom"
model="account.invoice"
string="Custom invoice report"
report_type="qweb-pdf"
name="custom_invoice_report.invoice_custom"
attachment_use="False"
file="custom_invoice_report.invoice_custom"
attachment = "(object.state in ('open','paid')) and ('F_'+(object.number or '').replace('/','')+'.pdf')"
paperformat_id = "1" <-- THIS DOES NOT WORK!
/>

paperformat_id is not a field of report but it has to be specified through relationship report.paperformat.

How could be specified such relationship through XML?

Avatar
Discard
Best Answer

<report

id="report_invoice_custom"

model="account.invoice"

string="Custom invoice report"

report_type="qweb-pdf"

name="custom_invoice_report.invoice_custom"

attachment_use="False"

file="custom_invoice_report.invoice_custom"

attachment = "(object.state in ('open','paid')) and ('F_'+(object.number or '').replace('/','')+'.pdf')"

/>

<record id="report_invoice_custom" model="ir.actions.report.xml">

<field name="paperformat_id" ref="custom_invoice_report.custompaperformat"/> <!-- Put Your Custom PaperFormat Id -->

</record>


Also you can refer this

<field name="paperformat_id" ref="report.paperformat_euro"/>

Avatar
Discard
Author

Thank you very much indeed, this is exactly what I was looking for.

Related Posts Replies Views Activity
2
Feb 20
27569
3
Jul 23
5658
0
Feb 22
3639
0
Oct 21
3813
0
Sep 15
4260