I want to print labels from odoo. For that I created a custom paper format and finding a way to link it to my label report. My label report is a pdf report. (When I create the report I can view it in the default paper format.)
我想从odoo打印标签。为此,我创建了一种自定义纸张格式,并找到了将其链接到我的标签报告的方法。我的标签报告是pdf报告。 (当我创建报告时,我可以以默认纸张格式查看它。)
this is the code for custom paper format
这是自定义纸张格式的代码
<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 my problem is how to link this paper format with my pdf report
我重复我的问题是如何将这种纸张格式与我的pdf报告联系起来
3 个解决方案
#1
15
Custom paper formate for Qweb report
Qweb报告的定制纸张形成
<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 the custom paper format to the QWeb report.
在这里,我将自定义纸张格式添加到QWeb报告中。
I hope this is helpful for you ..:)
我希望这对你有帮助.. :)
#2
1
you can also link the paper format from settings-->Report-->Reports-->search your report name--> open that in form view--> click edit button select the paper format from selection
您还可以从设置链接纸张格式 - >报告 - >报告 - >搜索您的报告名称 - >在表单视图中打开 - >单击编辑按钮从选择中选择纸张格式
#3
1
this's will work well :
这个会很好用的:
<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"
paperformat="your_module_name.paperformat_lowmargin"
/>
#1
15
Custom paper formate for Qweb report
Qweb报告的定制纸张形成
<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 the custom paper format to the QWeb report.
在这里,我将自定义纸张格式添加到QWeb报告中。
I hope this is helpful for you ..:)
我希望这对你有帮助.. :)
#2
1
you can also link the paper format from settings-->Report-->Reports-->search your report name--> open that in form view--> click edit button select the paper format from selection
您还可以从设置链接纸张格式 - >报告 - >报告 - >搜索您的报告名称 - >在表单视图中打开 - >单击编辑按钮从选择中选择纸张格式
#3
1
this's will work well :
这个会很好用的:
<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"
paperformat="your_module_name.paperformat_lowmargin"
/>