19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:12 +01:00
parent 79f83631d5
commit 73afc09215
6267 changed files with 1534193 additions and 1130106 deletions

View file

@ -6,11 +6,11 @@
<field name="inherit_id" ref="stock.view_template_property_form" />
<field name="arch" type="xml">
<group name="traceability" position="inside">
<field name="use_expiration_date" string="Expiration Date" attrs="{'invisible': [('tracking', '=','none')]}"/>
<field name="use_expiration_date" string="Expiration Date" invisible="tracking == 'none'"/>
</group>
<group name="stock_property" position="after">
<group string="Dates" name="expiry_and_lots" groups="stock.group_production_lot"
attrs="{'invisible': ['|', ('tracking', '=','none'), ('use_expiration_date', '=', False)]}">
invisible="tracking == 'none' or not use_expiration_date">
<label for="expiration_time"/>
<div>
<field name="expiration_time" class="oe_inline"/>

View file

@ -5,25 +5,27 @@
<field name="model">stock.lot</field>
<field name="inherit_id" ref="stock.view_production_lot_form" />
<field name="arch" type="xml">
<xpath expr="//page[@name='description']" position="before">
<page string="Dates" name="expiration_dates" attrs="{'invisible': [('use_expiration_date', '=', False)]}">
<xpath expr="//group[@name='description']" position="before">
<group string="Dates" name="expiration_dates" invisible="not use_expiration_date">
<field name="use_expiration_date" invisible="1"/>
<group>
<group>
<field name="expiration_date" />
<field name="removal_date" />
</group>
<group>
<field name="use_date" />
<field name="alert_date" />
</group>
<field string="Expiration" name="expiration_date"/>
<field string="Alert from" name="alert_date"/>
<field string="Best before" name="use_date"/>
<field string="Removal Date" name="removal_date"/>
</group>
</page>
</group>
</xpath>
<xpath expr="//div[hasclass('oe_title')]" position="inside">
<xpath expr="//div[hasclass('oe_title')]" position="before">
<field name="product_expiry_alert" invisible="1"/>
<span class="badge text-bg-danger" attrs="{'invisible': [('product_expiry_alert', '=', False)]}">Expiration Alert</span>
<span class="badge rounded-pill float-end text-bg-warning"
invisible="not (alert_date &lt;= time.strftime('%Y-%m-%d %H:%M:%S') &lt; expiration_date)">Expiring</span>
<span class="badge rounded-pill float-end text-bg-danger"
invisible="not product_expiry_alert">Expired</span>
</xpath>
<xpath expr="//field[@name='ref']" position="after">
<field name="expiration_date" invisible="not use_expiration_date or display_complete"/>
</xpath>
</field>
</record>
@ -33,23 +35,54 @@
<field name="inherit_id" ref="stock.search_product_lot_filter"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<filter string="Expiration Alerts" name="expiration_alerts" domain="[('alert_date', '&lt;=', time.strftime('%Y-%m-%d %H:%M:%S'))]"/>
<filter string="Expiration Alerts" name="expiration_alerts" domain="[('alert_date', '&lt;=', 'now')]"/>
</xpath>
</field>
</record>
<record id="view_production_lot_view_tree" model="ir.ui.view">
<field name="name">stock.production.lot.tree.inherit.product.expiry</field>
<field name="name">stock.production.lot.list.inherit.product.expiry</field>
<field name="model">stock.lot</field>
<field name="inherit_id" ref="stock.view_production_lot_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='create_date']" position="after">
<field name="product_qty" invisible="1"/>
<field name="alert_date" optional="hide" widget='remaining_days' attrs="{'invisible': [('product_qty', '&lt;=', 0)]}"/>
<field name="product_qty" column_invisible="True"/>
<field name="alert_date" optional="hide" widget='remaining_days' invisible="product_qty &lt;= 0"/>
<field name="use_date" optional="hide"/>
<field name="removal_date" optional="hide"/>
<field name="expiration_date" optional="hide"/>
</xpath>
</field>
</record>
<record id="view_production_lot_view_kanban" model="ir.ui.view">
<field name="name">stock.production.lot.kanban.inherit.product.expiry</field>
<field name="model">stock.lot</field>
<field name="inherit_id" ref="stock.view_production_lot_kanban"/>
<field name="arch" type="xml">
<xpath expr="//templates" position="before">
<field name="product_qty"/>
<field name="product_expiry_alert"/>
</xpath>
<xpath expr="//field[@name='name']" position="after">
<div>
<span title="Alert" class="fa fa-exclamation-triangle text-danger me-2"
invisible="product_qty &lt;= 0 or not product_expiry_alert or not expiration_date"/>
<field name="alert_date" widget='remaining_days' class="d-inline-block"/>
</div>
</xpath>
<xpath expr="//field[@name='product_id']" position="after">
<div invisible="not expiration_date">
<div>
<label for="expiration_date">Expiration: </label>
<field class="ms-2" name="expiration_date"/>
</div>
<div>
<label for="removal_date">Removal: </label>
<field class="ms-2" name="removal_date"/>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

View file

@ -5,18 +5,10 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="stock.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='group_lot_on_delivery_slip']" position="after">
<div class="col-12 col-lg-6 o_setting_box" attrs="{'invisible': ['|', ('group_lot_on_delivery_slip', '=', False), ('module_product_expiry', '=', False)]}" id="group_expiry_date_on_delivery_slip">
<div class="o_setting_left_pane">
<field name="group_expiry_date_on_delivery_slip"/>
</div>
<div class="o_setting_right_pane">
<label for="group_expiry_date_on_delivery_slip"/>
<div class="text-muted">
Expiration dates will appear on the delivery slip
</div>
</div>
</div>
<xpath expr="//setting[@id='group_lot_on_delivery_slip']" position="after">
<setting help="Expiration dates will appear on the delivery slip" invisible="not group_lot_on_delivery_slip or not module_product_expiry" id="group_expiry_date_on_delivery_slip">
<field name="group_expiry_date_on_delivery_slip"/>
</setting>
</xpath>
</field>
</record>

View file

@ -13,45 +13,41 @@
</record>
<record id="view_stock_move_line_operation_tree_expiry" model="ir.ui.view">
<field name="name">stock.move.line.inherit.tree</field>
<field name="name">stock.move.line.inherit.list</field>
<field name="model">stock.move.line</field>
<field name="inherit_id" ref="stock.view_stock_move_line_operation_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='lot_id']" position="after">
<field name="is_expired" invisible="1"/>
<button class="fa fa-exclamation-triangle text-danger"
title="This lot is expired." string="This lot is expired"
disabled="1"
attrs="{'invisible': [('is_expired', '=', False)]}"/>
<field name="is_expired" column_invisible="True"/>
</xpath>
<xpath expr="//field[@name='lot_name']" position="after" >
<field name="picking_type_use_existing_lots" invisible="1"/>
<field name="expiration_date" force_save="1" attrs="{
'column_invisible': ['|', ('parent.use_expiration_date', '!=', True), ('parent.picking_code', '!=', 'incoming')],
'readonly': [('picking_type_use_existing_lots', '=', True)],
}"/>
<field name="picking_type_use_existing_lots" column_invisible="True"/>
<field name="expiration_date" force_save="1" column_invisible="not parent.use_expiration_date" readonly="picking_type_use_existing_lots"
decoration-danger="is_expired if state == 'done' else expiration_date &lt; context_today().strftime('%Y-%m-%d')"
decoration-bf="is_expired if state == 'done' else expiration_date &lt; context_today().strftime('%Y-%m-%d')"/>
<field name="removal_date" force_save="1" column_invisible="not parent.use_expiration_date" readonly="picking_type_use_existing_lots"
decoration-danger="removal_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"
decoration-bf="removal_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"/>
</xpath>
</field>
</record>
<record id="view_stock_move_line_detailed_operation_tree_expiry" model="ir.ui.view">
<field name="name">stock.move.line.operations.inherit.tree</field>
<field name="name">stock.move.line.operations.inherit.list</field>
<field name="model">stock.move.line</field>
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='lot_name']" position="after">
<field name="picking_type_use_existing_lots" invisible="1"/>
<field name="expiration_date" force_save="1" attrs="{
'column_invisible': [('parent.picking_type_code', '!=', 'incoming')],
'readonly': [('picking_type_use_existing_lots', '=', True)],
}"/>
<field name="picking_type_use_existing_lots" column_invisible="True"/>
<field name="tracking" column_invisible="True"/>
<field name="expiration_date" decoration-danger="is_expired if state == 'done' else expiration_date &lt; context_today().strftime('%Y-%m-%d')"
decoration-bf="is_expired if state == 'done' else expiration_date &lt; context_today().strftime('%Y-%m-%d')"
force_save="1" readonly="picking_type_use_existing_lots" invisible="tracking == 'none'"/>
<field name="removal_date" force_save="1" readonly="1" invisible="tracking == 'none'"
decoration-danger="removal_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')" decoration-bf="removal_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"/>
</xpath>
<xpath expr="//field[@name='lot_id']" position="after">
<field name="is_expired" invisible="1"/>
<button class="fa fa-exclamation-triangle text-danger"
title="This lot is expired." string="This lot is expired"
disabled="1"
attrs="{'invisible': [('is_expired', '=', False)]}"/>
<field name="is_expired" column_invisible="True"/>
</xpath>
</field>
</record>

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding='UTF-8'?>
<odoo>
<record id="view_stock_quant_tree_expiry" model="ir.ui.view">
<field name="name">stock.quant.inherit.form</field>
<record id="view_stock_quant_tree" model="ir.ui.view">
<field name="name">stock.quant.list.inherit.expiry_date</field>
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<xpath expr="//list" position="attributes">
<attribute name="decoration-danger">
removal_date &lt; current_date or quantity &lt; 0
(removal_date and removal_date &lt; current_date) or quantity &lt; 0
</attribute>
</xpath>
<xpath expr="//field[@name='quantity']" position="after" >
@ -16,15 +16,36 @@
</field>
</record>
<record id="view_stock_quant_tree_editable_expiry" model="ir.ui.view">
<field name="name">stock.quant.inherit.form</field>
<record id="view_stock_quant_tree_editable" model="ir.ui.view">
<field name="name">stock.quant.list.editable.inherit.expiry_date</field>
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree_editable"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='lot_id']" position="after">
<field name="use_expiration_date" invisible="1"/>
<field name="removal_date" optional="hide"
invisible="context.get('hide_removal_date')" attrs="{'readonly': ['|', ('tracking', '=', 'none'), ('use_expiration_date', '=', False)]}"/>
<field name="use_expiration_date" column_invisible="True"/>
<field name="expiration_date" column_invisible="not context.get('show_removal_date')"
decoration-danger="expiration_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"
decoration-bf="expiration_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"/>
<field name="removal_date" column_invisible="not context.get('show_removal_date')"
decoration-danger="removal_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"
decoration-bf="expiration_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"/>
</xpath>
</field>
</record>
<record id="view_stock_quant_tree_inventory_editable" model="ir.ui.view">
<field name="name">stock.quant.inventory.list.editable.inherit.expiry_date</field>
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree_inventory_editable"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='lot_id']" position="after">
<field name="use_expiration_date" column_invisible="True"/>
<field name="expiration_date" groups="stock.group_production_lot"
column_invisible="not context.get('show_removal_date')"
decoration-danger="expiration_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')" decoration-bf="expiration_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"/>
<field name="removal_date" groups="stock.group_production_lot"
column_invisible="not context.get('show_removal_date')"
decoration-danger="removal_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')" decoration-bf="removal_date &lt; (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"/>
</xpath>
</field>
</record>
@ -34,11 +55,13 @@
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.quant_search_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='reserved']" position="after">
<xpath expr="//filter[@name='negative']" position="after">
<separator/>
<filter string="Expiration Alerts" name="expiration_alerts"
domain="[('lot_id.alert_date', '&lt;=', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="Expired Lots" name="expired_lots"
domain="[('expiration_date', '&lt;', 'today')]"/>
<filter string="Alert Lots" name="alert_lots"
domain="[('lot_id.alert_date', '&lt;=', 'today')]"/>
</xpath>
</field>
</record>
</record>
</odoo>