Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Add paperformat to a report or how to add a relationship to a new generated report

By
E.M.
on 9/24/15, 5:05 AM 359 views

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?

2
Jaydeep Barot (jar)
On 9/24/15, 9:20 AM

<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"/>

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

E.M.
on 9/24/15, 10:36 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/24/15, 5:05 AM
Seen: 359 times
Last updated: 9/24/15, 10:36 AM