Skip to content

Commit 2b3f346

Browse files
committed
[IMP] stock_grn: Add ZPL label
1 parent deb9cbb commit 2b3f346

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

stock_grn/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"data/stock_grn.xml",
1919
"security/ir.model.access.csv",
2020
"security/ir_rule.xml",
21+
"reports/stock_grn.xml",
2122
],
2223
"installable": True,
2324
"auto_install": False,

stock_grn/reports/stock_grn.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!-- Copyright 2025 ACSONE SA/NV
3+
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
4+
<odoo>
5+
<template id="label_stock_grn">
6+
<t t-set="curr_date" t-value="datetime.datetime.today()" />
7+
<t t-foreach="docs" t-as="grn">
8+
9+
^XA
10+
<t t-name="supplier_name">
11+
^CF0,60
12+
^FO10,50^FD<t t-esc="grn.supplier_id.display_name" />^FS
13+
</t>
14+
<t t-name="reference">
15+
^CF0,30
16+
^FO10,115^FDREF: <t t-esc="grn.ref" />^FS
17+
</t>
18+
<t t-name="origin">
19+
^FO10,150^FDORIGIN: <t
20+
t-esc="','.join([origin for origin in grn.picking_ids.mapped('origin') if origin])"
21+
/>^FS
22+
</t>
23+
<t t-name="grn_name">
24+
^FO10,185^FDGRN: <t t-esc="grn.name" />^FS
25+
</t>
26+
<t t-name="grn_date">
27+
^FO10,220^FDDATE: <t t-esc="curr_date" t-options='{"widget": "date"}' />^FS
28+
</t>
29+
<t t-name="grn_qr">
30+
^BQN,2,6,M,7
31+
^FO500,50^FH^FDQA,<t t-esc="grn.name" />^FS
32+
</t>
33+
^XZ
34+
</t>
35+
</template>
36+
37+
38+
<record model="ir.actions.report" id="report_stock_grn_label">
39+
<field name="name">GRN Label (ZPL)</field>
40+
<field name="model">stock.grn</field>
41+
<field name="report_type">qweb-text</field>
42+
<field name="report_name">stock_grn.label_stock_grn</field>
43+
<field name="report_file">stock_grn.label_stock_grn</field>
44+
<field name="binding_model_id" ref="model_stock_grn" />
45+
<field name="binding_type">report</field>
46+
</record>
47+
</odoo>

0 commit comments

Comments
 (0)