How to associate custom paper size with pdf message in odoo 8.0

I want to print labels with ode. To do this, I created my own paper format and found a way to associate it with my label. My shortcut report is a pdf report. (When I create a report, I can view it in the default paper format.)

this is a code for custom paper size

<openerp> <data> <record id="mymodule_label" model="report.paperformat"> <field name="name">Item Label</field> <field name="default" eval="True"/> <field name="format">custom</field> <field name="page_height">50</field> <field name="page_width">100</field> <field name="orientation">Portrait</field> <field name="margin_top">3</field> <field name="margin_bottom">3</field> <field name="margin_left">3</field> <field name="margin_right">3</field> <field name="header_line" eval="False"/> <field name="header_spacing">3</field> <field name="dpi">80</field> </record> </data> </openerp> 

I repeat that my problem is how to associate this paper format with my pdf report

+5
source share
2 answers

Custom Document Format for Qweb Report

 <report id="lukasz_orders_report_qweb" string="Drukuj Zgloszenie" model="lukasz.orders" report_type="qweb-pdf" name="your_module_name.lukasz_orders_report" file="your_module_name.lukasz_orders_report" /> <record id="paperformat_lowmargin" model="report.paperformat"> <field name="name">European A4 low margin</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">Portrait</field> <field name="margin_top">4</field> <field name="margin_bottom">4</field> <field name="margin_left">4</field> <field name="margin_right">4</field> <field name="header_line" eval="False" /> <field name="header_spacing">0</field> <field name="dpi">90</field> </record> <record id="your_module_name.lukasz_orders_report_qweb" model="ir.actions.report.xml"> <field name="paperformat_id" ref="your_module_name.paperformat_lowmargin" /> </record> 

Here I added a custom paper format to the QWeb report.

I hope this is helpful to you .. :)

+15
source

you can also associate the paper format with settings-->Report-->Reports-->search your report name--> open that in form view--> click edit button select the paper format from selection

+1
source

All Articles