[IMP] stock: improve stock quant list view

- Added new field 'reserved_quantity'.
- Added new filter Reservations('reserved_quantity').
- Removed 'Transit Location' default filter and keep only 'Internal Location'.
- Added graph view in stock quant.
- Added Product Template in search view.
This commit is contained in:
Haresh Shyara
2017-08-30 21:17:32 -07:00
committed by Joren Van Onder
parent e7b8033771
commit cc07b482fe
2 changed files with 24 additions and 6 deletions
+4
View File
@@ -15,6 +15,10 @@ class StockQuant(models.Model):
product_id = fields.Many2one(
'product.product', 'Product',
ondelete='restrict', readonly=True, required=True)
# so user can filter on template in webclient
product_tmpl_id = fields.Many2one(
'product.template', string='Product Template',
related='product_id.product_tmpl_id')
product_uom_id = fields.Many2one(
'product.uom', 'Unit of Measure',
readonly=True, related='product_id.uom_id')
+20 -6
View File
@@ -18,6 +18,7 @@
<separator/>
<filter name="negative" string="Negative Stock" domain="[('quantity', '&lt;', 0.0)]"/>
<filter name="positive" string="Positive Stock" domain="[('quantity', '&gt;', 0.0)]"/>
<filter name="reserved" string="Reservations" domain="[('reserved_quantity', '&gt;', 0.0)]"/>
</group>
<group expand='0' string='Group by...'>
<filter string='Location' name="locationgroup" domain="[]" context="{'group_by': 'location_id'}"/>
@@ -62,12 +63,13 @@
<field name="arch" type="xml">
<tree string="Inventory Valuation" create="0" delete="0">
<field name="product_id"/>
<field name="quantity"/>
<field name="product_uom_id" groups="product.group_uom"/>
<field name="location_id"/>
<field name="owner_id" groups="stock.group_tracking_owner"/>
<field name="lot_id" groups="stock.group_production_lot"/>
<field name="package_id" groups="stock.group_tracking_lot"/>
<field name="reserved_quantity" string="Reserved"/>
<field name="quantity" string="On Hand"/>
<field name="product_uom_id" groups="product.group_uom"/>
<field name="owner_id" groups="stock.group_tracking_owner"/>
<field name='company_id' groups="base.group_multi_company"/>
</tree>
</field>
@@ -79,18 +81,30 @@
<field name="model">stock.quant</field>
<field name="arch" type="xml">
<pivot string="Inventory">
<field name="location_id" type="row"/>
<field name="product_id" type="row"/>
<field name="location_id" type="col"/>
<field name="quantity" type="measure"/>
</pivot>
</field>
</record>
<record id="stock_quant_view_graph" model="ir.ui.view">
<field name="name">stock.quant.graph</field>
<field name="model">stock.quant</field>
<field name="arch" type="xml">
<graph string="Stock Quant">
<field name="location_id"/>
<field name="quantity" type="measure"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="quantsact"> <!-- Menu + python -->
<field name="name">Inventory</field>
<field name="res_model">stock.quant</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,pivot</field>
<field name="context">{'search_default_internal_loc': 1, 'search_default_transit_loc': 1}</field>
<field name="view_mode">tree,form,pivot,graph</field>
<field name="context">{'search_default_internal_loc': 1,}</field>
<field name="help">This analysis gives you a fast overview on the current stock level of your products and their current inventory value.</field>
</record>
<record model="ir.actions.act_window" id="product_template_open_quants"> <!-- Not used -->