バーコード付きレポートテンプレートでは、この例ではqrcodeが使用されますが、ニーズに合わせて変更することができます。いくつかのスタイルを追加することもできます。
<template id="report_label_style" inherit_id="website_report.layout">
<xpath expr="//style" position="after">
<style type="text/css">
.example_class {
display: block;
width: 228px;
height: 103px;
}
</style>
</xpath>
</template>
<template id="report_label">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<div class="page">
<div class="row">
<div class="example_class">
<t t-set="qr_src">/report/barcode/?type=QR&value=<t t-esc="o.qr_string" />&width=600&height=600</t>
<img t-att-src="'%s' % qr_src"/>
</div>
</div>
</div>
</t>
</t>
</template>
ペーパーフォーマット定義。あなたがに行く場合は、paperformatが表示されます。
はここ
<report id="action_report_label"
model="model.name"
report_type="qweb-pdf"
name="module_name.report_label"
file="module_name.report_label"
string="Label" />
私は関連付ける:設定>レポート>ペーパーフォーマ
<record id="paperformat_label_example" model="report.paperformat">
<field name="name">Paperformat Example</field>
<field name="default" eval="True"/>
<field name="format">custom</field>
<field name="page_height">23</field>
<field name="page_width">50</field>
<field name="orientation">Portrait</field>
<field name="margin_top">0</field>
<field name="margin_bottom">0</field>
<field name="margin_left">0</field>
<field name="margin_right">0</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">0</field>
<field name="dpi">80</field>
</record>
レポートアクション、これはモデルir_act_report_xml
に必要なレコードを作成しますペーパーフォーマット:
<record id="module_name.action_report_label" model="ir.actions.report.xml">
<field name="paperformat_id" ref="module_name.paperformat_label_example"/>
</record>
カスタムペーパーフォーマットを使用する必要があります。設定>レポート>用紙フォーマット – ChesuCR
あなたは適切なレイアウトを使用する必要があります。 – ChesuCR