<odoo>
    <data>
        <!--        托盘码打印尺寸-->
        <record id="sf_tray1" model="report.paperformat">
            <field name="name">Dymo Label Sheet</field>
            <field name="default" eval="True"/>
            <field name="format">custom</field>
            <field name="page_height">100</field>
            <field name="page_width">60</field>
            <field name="orientation">Landscape</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="disable_shrinking" eval="True"/>
            <field name="dpi">96</field>
        </record>

        <!--        托盘码打印动作-->
        <record id="label_sf_tray_code" model="ir.actions.report">
            <field name="name">打印条形码</field>
            <field name="model">sf.tray</field>
            <field name="report_type">qweb-pdf</field>
            <field name="report_name">sf_manufacturing.sf_tray_template</field>
            <field name="report_file">sf_manufacturing.sf_tray_template</field>
            <field name="binding_model_id" ref="model_sf_tray"/>
            <field name="binding_type">report</field>
            <field name="paperformat_id" ref="sf_manufacturing.sf_tray1"/>

        </record>
        <!--        托盘码打印模板-->
        <template id="sf_tray_template">
            <t t-call="web.html_container">
                <t t-call="web.external_layout">
                    <t t-foreach="docs" t-as="o">
                        <div class="page">
                            <div t-field="o.code"
                                 t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}"/>
                            <div t-field="o.code" style="text-align: center"/>
                        </div>
                    </t>
                </t>
            </t>

        </template>

        <!--       产品信息打印动作-->
        <record id="label_sf_tray_code1" model="ir.actions.report">
            <field name="name">打印产品信息</field>
            <field name="model">mrp.workorder</field>
            <field name="report_type">qweb-pdf</field>
            <field name="report_name">sf_manufacturing.sf_tray_template1</field>
            <field name="report_file">sf_manufacturing.sf_tray_template1</field>
            <field name="binding_model_id" ref="model_mrp_workorder"/>
            <field name="binding_type">report</field>
            <field name="paperformat_id" ref="sf_manufacturing.sf_tray1"/>
        </record>

        <!--        产品信息打印模板-->
        <template id="sf_tray_template1">
            <t t-call="web.html_container">
                <t t-call="web.external_layout">
                    <t t-foreach="docs" t-as="o">
                        <div class="page">
                            <div t-field="o.production_id.name"
                                 t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}"/>
                            <div t-field="o.production_id" style="text-align: center"/>
                        </div>
                    </t>
                </t>
            </t>
        </template>
    </data>
</odoo>
