feat: Add production and expiration dates to stock move lines and update delivery slip report
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- Inherit the delivery slip report template for completed deliveries (state='done') -->
|
||||
<template id="stock_report_delivery_has_serial_move_line_custom" inherit_id="stock.stock_report_delivery_has_serial_move_line">
|
||||
<!-- Add Production Date after lot number -->
|
||||
<xpath expr="//td[@name='move_line_lot']" position="after">
|
||||
<td class="text-end">
|
||||
<span t-esc="datetime.datetime.now().strftime('%Y-%m-%d')"/>
|
||||
</td>
|
||||
</xpath>
|
||||
<!-- Add Expiration Date after Production Date -->
|
||||
<xpath expr="//td[@name='move_line_lot_quantity']" position="before">
|
||||
<td class="text-end">
|
||||
<span t-esc="(datetime.datetime.now() + datetime.timedelta(days=180)).strftime('%Y-%m-%d')"/>
|
||||
</td>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- Add column headers for Production and Expiration dates in the main table -->
|
||||
<template id="report_delivery_document_custom" inherit_id="stock.report_delivery_document">
|
||||
<!-- Add headers for completed deliveries table -->
|
||||
<xpath expr="//table[@name='stock_move_line_table']/thead/tr/th[@name='lot_serial']" position="after">
|
||||
<th name="th_production_date" class="text-end">Production Date</th>
|
||||
<th name="th_expiration_date" class="text-end">Expiration Date</th>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- Add production and expiration date fields to stock move lines -->
|
||||
<record id="view_stock_move_line_tree" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.tree.custom</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_move_line_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="after">
|
||||
<field name="production_date" optional="show"/>
|
||||
<field name="expiration_date" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user