summaryrefslogtreecommitdiff
path: root/addons/product_expiry/report
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/product_expiry/report
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/product_expiry/report')
-rw-r--r--addons/product_expiry/report/report_deliveryslip.xml22
-rw-r--r--addons/product_expiry/report/report_lot_barcode.xml62
2 files changed, 84 insertions, 0 deletions
diff --git a/addons/product_expiry/report/report_deliveryslip.xml b/addons/product_expiry/report/report_deliveryslip.xml
new file mode 100644
index 00000000..1d390ee1
--- /dev/null
+++ b/addons/product_expiry/report/report_deliveryslip.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <template id="stock_report_delivery_document_inherit_product_expiry" inherit_id="stock.report_delivery_document">
+ <xpath expr="//t[@name='lot_serial']" position="after">
+ <t t-set="has_expiry_date" t-value="False"/>
+ <t t-set="has_expiry_date"
+ t-value="o.move_line_ids.filtered(lambda ml: ml.lot_id.expiration_date)"
+ groups="product_expiry.group_expiry_date_on_delivery_slip"/>
+ <t name="expiry_date" t-if="has_expiry_date">
+ <th>Expiration Date</th>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="stock_report_delivery_has_serial_move_line_inherit_product_expiry" inherit_id="stock.stock_report_delivery_has_serial_move_line">
+ <xpath expr="//t[@name='move_line_lot']" position="after">
+ <t t-if="has_expiry_date">
+ <td><span t-field="move_line.lot_id.expiration_date" t-options='{"widget": "date"}'/></td>
+ </t>
+ </xpath>
+ </template>
+</odoo>
diff --git a/addons/product_expiry/report/report_lot_barcode.xml b/addons/product_expiry/report/report_lot_barcode.xml
new file mode 100644
index 00000000..5e464dd9
--- /dev/null
+++ b/addons/product_expiry/report/report_lot_barcode.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+<template id="report_lot_label_expiry" inherit_id="stock.report_lot_label">
+ <xpath expr="//tr[@name='lot_name']" position="after">
+ <tr t-if="o.use_expiration_date">
+ <td>
+ <div t-if="o.use_date">
+ Best before:
+ <span style="float:right;" t-field="o.use_date" t-options='{"widget": "date"}'/>
+ </div>
+ <div t-if="o.expiration_date">
+ Use by:
+ <span style="float:right;" t-field="o.expiration_date" t-options='{"widget": "date"}'/>
+ </div>
+ </td>
+ </tr>
+ </xpath>
+</template>
+
+<template id="label_lot_template_view_expiry" inherit_id="stock.label_lot_template_view">
+ <xpath expr="//t" position="replace">
+ <t t-foreach="docs" t-as="lot">
+ <t t-translation="off">
+^XA
+^FO100,50
+^A0N,44,33^FD<t t-esc="lot.product_id.display_name"/>^FS
+^FO100,100
+^A0N,44,33^FDLN/SN: <t t-esc="lot.name"/>^FS
+<t t-if="lot.use_expiration_date and lot.use_date">
+^FO100,150
+^A0N,44,33^FDBest before: <t t-esc="lot.use_date" t-options='{"widget": "date"}'/>^FS
+<t t-if="lot.expiration_date">
+^FO100,200
+^A0N,44,33^FDUse by: <t t-esc="lot.expiration_date" t-options='{"widget": "date"}'/>^FS
+^FO100,250^BY3
+^BCN,100,Y,N,N
+^FD<t t-esc="lot.name"/>^FS
+</t>
+<t t-else="">
+^FO100,200^BY3
+^BCN,100,Y,N,N
+^FD<t t-esc="lot.name"/>^FS
+</t>
+</t>
+<t t-elif="lot.use_expiration_date and lot.expiration_date">
+^FO100,150
+^A0N,44,33^FDUse by: <t t-esc="lot.expiration_date" t-options='{"widget": "date"}'/>^FS
+^FO100,200^BY3
+^BCN,100,Y,N,N
+^FD<t t-esc="lot.name"/>^FS
+</t>
+<t t-else="">
+^FO100,150^BY3
+^BCN,100,Y,N,N
+^FD<t t-esc="lot.name"/>^FS
+</t>
+^XZ
+ </t>
+ </t>
+ </xpath>
+</template>
+</odoo>