| 1 |
<?xml version="1.0" encoding='UTF-8'?> |
| 2 |
<odoo> |
| 3 |
<record id="view_stock_quant_tree" model="ir.ui.view"> |
| 4 |
<field name="name">stock.quant.list.inherit.expiry_date</field> |
| 5 |
<field name="model">stock.quant</field> |
| 6 |
<field name="inherit_id" ref="stock.view_stock_quant_tree"/> |
| 7 |
<field name="arch" type="xml"> |
| 8 |
<xpath expr="//list" position="attributes"> |
| 9 |
<attribute name="decoration-danger"> |
| 10 |
(removal_date and removal_date < current_date) or quantity < 0 |
| 11 |
</attribute> |
| 12 |
</xpath> |
| 13 |
<xpath expr="//field[@name='quantity']" position="after" > |
| 14 |
<field name="removal_date"/> |
| 15 |
</xpath> |
| 16 |
</field> |
| 17 |
</record> |
| 18 |
|
| 19 |
<record id="view_stock_quant_tree_editable" model="ir.ui.view"> |
| 20 |
<field name="name">stock.quant.list.editable.inherit.expiry_date</field> |
| 21 |
<field name="model">stock.quant</field> |
| 22 |
<field name="inherit_id" ref="stock.view_stock_quant_tree_editable"/> |
| 23 |
<field name="arch" type="xml"> |
| 24 |
<xpath expr="//field[@name='lot_id']" position="after"> |
| 25 |
<field name="use_expiration_date" column_invisible="True"/> |
| 26 |
<field name="expiration_date" column_invisible="not context.get('show_removal_date')" |
| 27 |
decoration-danger="expiration_date < (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')" |
| 28 |
decoration-bf="expiration_date < (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"/> |
| 29 |
<field name="removal_date" column_invisible="not context.get('show_removal_date')" |
| 30 |
decoration-danger="removal_date < (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')" |
| 31 |
decoration-bf="expiration_date < (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"/> |
| 32 |
</xpath> |
| 33 |
</field> |
| 34 |
</record> |
| 35 |
|
| 36 |
<record id="view_stock_quant_tree_inventory_editable" model="ir.ui.view"> |
| 37 |
<field name="name">stock.quant.inventory.list.editable.inherit.expiry_date</field> |
| 38 |
<field name="model">stock.quant</field> |
| 39 |
<field name="inherit_id" ref="stock.view_stock_quant_tree_inventory_editable"/> |
| 40 |
<field name="arch" type="xml"> |
| 41 |
<xpath expr="//field[@name='lot_id']" position="after"> |
| 42 |
<field name="use_expiration_date" column_invisible="True"/> |
| 43 |
<field name="expiration_date" groups="stock.group_production_lot" |
| 44 |
column_invisible="not context.get('show_removal_date')" |
| 45 |
decoration-danger="expiration_date < (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')" decoration-bf="expiration_date < (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"/> |
| 46 |
<field name="removal_date" groups="stock.group_production_lot" |
| 47 |
column_invisible="not context.get('show_removal_date')" |
| 48 |
decoration-danger="removal_date < (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')" decoration-bf="removal_date < (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')"/> |
| 49 |
</xpath> |
| 50 |
</field> |
| 51 |
</record> |
| 52 |
|
| 53 |
<record id="quant_search_view_inherit_product_expiry" model="ir.ui.view"> |
| 54 |
<field name="name">stock.quant.search.inherit</field> |
| 55 |
<field name="model">stock.quant</field> |
| 56 |
<field name="inherit_id" ref="stock.quant_search_view"/> |
| 57 |
<field name="arch" type="xml"> |
| 58 |
<xpath expr="//filter[@name='negative']" position="after"> |
| 59 |
<separator/> |
| 60 |
<filter string="Expired Lots" name="expired_lots" |
| 61 |
domain="[('expiration_date', '<', 'today')]"/> |
| 62 |
<filter string="Alert Lots" name="alert_lots" |
| 63 |
domain="[('lot_id.alert_date', '<=', 'today')]"/> |
| 64 |
</xpath> |
| 65 |
</field> |
| 66 |
</record> |
| 67 |
</odoo> |