diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/product_expiry/views/stock_quant_views.xml | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/product_expiry/views/stock_quant_views.xml')
| -rw-r--r-- | addons/product_expiry/views/stock_quant_views.xml | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/addons/product_expiry/views/stock_quant_views.xml b/addons/product_expiry/views/stock_quant_views.xml new file mode 100644 index 00000000..d15b1437 --- /dev/null +++ b/addons/product_expiry/views/stock_quant_views.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding='UTF-8'?> +<odoo> + <record id="view_quant_form_expiry" model="ir.ui.view"> + <field name="name">stock.quant.inherit.form</field> + <field name="model">stock.quant</field> + <field name="inherit_id" ref="stock.view_stock_quant_form"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='lot_id']" position="after" > + <field name="removal_date"/> + </xpath> + </field> + </record> + + <record id="view_stock_quant_tree_expiry" model="ir.ui.view"> + <field name="name">stock.quant.inherit.form</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"> + <attribute name="decoration-danger"> + removal_date < current_date or quantity < 0 + </attribute> + </xpath> + <xpath expr="//field[@name='quantity']" position="after" > + <field name="removal_date"/> + </xpath> + </field> + </record> + + <record id="view_stock_quant_tree_editable_expiry" model="ir.ui.view"> + <field name="name">stock.quant.inherit.form</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='inventory_quantity']" position="before"> + <field name="use_expiration_date" invisible="1"/> + <field name="removal_date" optional="show" + invisible="context.get('hide_removal_date')" attrs="{'readonly': ['|', ('tracking', '=', 'none'), ('use_expiration_date', '=', False)]}"/> + </xpath> + </field> + </record> + + <record id="quant_search_view_inherit_product_expiry" model="ir.ui.view"> + <field name="name">stock.quant.search.inherit</field> + <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"> + <separator/> + <filter string="Expiration Alerts" name="expiration_alerts" + domain="[('removal_date', '<=', context_today().strftime('%Y-%m-%d'))]"/> + </xpath> + </field> + </record> +</odoo> |
