Reputation: 805
I want to design a custom qweb report in Landscape format.I want to do that from backend.Lets assume test_module
is my module name.
I tried like this :
<report
id="report_sale_order_landscape_id"
model="sale.order"
string="Sale Order Landscape"
report_type="qweb-pdf"
name="sale.report_sale_order_landscape"
file="sale.report_sale_order_landscape"
/>
<record id="paperformat_sale_order_landscape" model="report.paperformat">
<field name="name">PF Sale Order Landscape</field>
<field name="default" eval="True"/>
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Landscape</field>
<field name="margin_top">10</field>
<field name="margin_bottom">15</field>
<field name="margin_left">7</field>
<field name="margin_right">7</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">3</field>
<field name="dpi">90</field>
</record>
<record id="report_sale_order_landscape" model="ir.actions.report.xml">
<field name="paperformat_id" ref="paperformat_sale_order_landscape" />
</record>
But I am facing some errors. Please Help. Thanks in Advance.
Upvotes: 1
Views: 3091
Reputation: 11
Instead of using:
<record id="report_sale_order_landscape" model="ir.actions.report.xml">
<field name="paperformat_id" ref="paperformat_sale_order_landscape" />
</record>
You can add paperformat attribute inside report definition:
<report
id="report_sale_order_landscape_id"
model="sale.order"
string="Sale Order Landscape"
report_type="qweb-pdf"
name="sale.report_sale_order_landscape"
file="sale.report_sale_order_landscape"
paperformat="test_module.report_sale_order_landscape"
/>
Upvotes: 0
Reputation: 666
Try this may be help you
<record id="paperformat_sale_order_landscape" model="report.paperformat">
<field name="name">PF Sale Order Landscape</field>
<field name="default" eval="True"/>
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Landscape</field>
<field name="margin_top">10</field>
<field name="margin_bottom">15</field>
<field name="margin_left">7</field>
<field name="margin_right">7</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">3</field>
<field name="dpi">90</field>
<report
id="report_sale_order_landscape_id"
model="sale.order"
string="Sale Order Landscape"
report_type="qweb-pdf"
name="sale.report_sale_order_landscape"
file="sale.report_sale_order_landscape"
paperformat="paperformat_sale_order_landscape"
/>
Upvotes: 4