summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2017-08-11 15:56:33 +0200
committerNicolas Martinelli <nim@odoo.com>2017-11-03 09:54:30 +0100
commit084dbf9b8f258e453c4a5958bc146c8f4c4ddbbb (patch)
treed0b69ba0544d87630d0764f14cd422071f109af5
parent5aebc2272233934273c1023ace78141c36f582cb (diff)
[FIX] stock: inventory adjustment
The inventory adjustment form is not suitable for large inventories. First, a list view embedded in a form view is not convenient since it doesn't provide any search capabilities. The user has to rely on the search feature of the browser, which has restricted features in comparison to the Odoo search field. Then, the existing onchange mechanism coupled with computed fields triggers heavy computations impacting all lines each time a single line is modified. This leads to a hanging page for every inventory line modification, which causes a non-negligeable loss of time. This commit introduces a new tree view for inventory lines, accessible thanks to a stat button on the inventory page. This button is available in debug mode, if the inventory is in state 'Confirmed'. The tree view contains the same fields than the tree view embedded in the form view, without the flaws of the latter. opw-760614
-rw-r--r--addons/stock/views/stock_inventory_views.xml23
1 files changed, 23 insertions, 0 deletions
diff --git a/addons/stock/views/stock_inventory_views.xml b/addons/stock/views/stock_inventory_views.xml
index db133d114d9..d3394da3c13 100644
--- a/addons/stock/views/stock_inventory_views.xml
+++ b/addons/stock/views/stock_inventory_views.xml
@@ -120,6 +120,19 @@
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/>
</header>
<sheet>
+ <div class="oe_button_box" name="button_box">
+ <button name="action_inventory_line_tree"
+ class="oe_stat_button"
+ icon="fa-building-o"
+ type="object"
+ help="List view of lines"
+ groups="base.group_no_one"
+ states="confirm">
+ <div class="o_form_field o_stat_info">
+ <span class="o_stat_text">Details</span>
+ </div>
+ </button>
+ </div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" placeholder="e.g. Annual inventory"/></h1>
@@ -247,5 +260,15 @@
</field>
</record>
+ <record id="action_inventory_line_tree" model="ir.actions.act_window">
+ <field name="name">Inventory Lines</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">stock.inventory.line</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree</field>
+ <field name="view_id" ref="stock_inventory_line_tree2"/>
+ <field name="domain">[('inventory_id', '=', active_id)]</field>
+ </record>
+
<menuitem action="action_inventory_form" id="menu_action_inventory_form" parent="menu_stock_warehouse_mgmt" sequence="30"/>
</odoo>