-
-
Notifications
You must be signed in to change notification settings - Fork 808
/
Copy pathreport_label.xml
52 lines (49 loc) · 2.33 KB
/
report_label.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="report_label_template">
<t t-call="web.basic_layout">
<t t-set="full_width" t-value="True" />
<t t-set="label_style">
height: <t t-esc="label_format['label_height']" />mm;
width: <t t-esc="label_format['label_width']" />mm;
padding-top: <t t-esc="label_format['label_padding_top']" />mm;
padding-right: <t t-esc="label_format['label_padding_right']" />mm;
padding-bottom: <t t-esc="label_format['label_padding_bottom']" />mm;
padding-left: <t t-esc="label_format['label_padding_left']" />mm;
margin-top: <t t-esc="label_format['label_margin_top']" />mm;
margin-right: <t t-esc="label_format['label_margin_right']" />mm;
margin-bottom: <t t-esc="label_format['label_margin_bottom']" />mm;
margin-left: <t t-esc="label_format['label_margin_left']" />mm;
display: inline-block;
overflow: hidden;
float: left;
position: relative;
page-break-inside: avoid;
box-sizing: border-box;
</t>
<!-- Offset: Skip the first [offset] labels -->
<t t-foreach="range(0, offset)" t-as="i">
<div t-att-style="label_style" />
</t>
<t t-foreach="lines" t-as="line">
<t t-foreach="range(0, line['quantity'])" t-as="i">
<div t-att-style="label_style">
<t t-call="{{label_template}}">
<t
t-set="record"
t-value="docs.env[res_model].browse(line['res_id'])"
/>
</t>
</div>
</t>
</t>
</t>
</template>
<record id="report_label" model="ir.actions.report">
<field name="name">Label Report</field>
<field name="model">report.label.wizard</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">report_label.report_label_template</field>
<field name="report_file">report_label.report_label_template</field>
</record>
</odoo>