Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
7184 Ansichten

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
Verwerfen
Beste Antwort

<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
Verwerfen
Autor

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

Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Feb. 20
28984
3
Juli 23
6939
0
Feb. 22
4534
0
Okt. 21
5064
0
Sept. 15
5559