Merge lp:~ovnicraft/openobject-addons/trunk-stock-picking-location-context into lp:openobject-addons

Proposed by Cristian Salamea
Status: Work in progress
Proposed branch: lp:~ovnicraft/openobject-addons/trunk-stock-picking-location-context
Merge into: lp:openobject-addons
Diff against target: 93 lines (+21/-18)
1 file modified
stock/stock_view.xml (+21/-18)
To merge this branch: bzr merge lp:~ovnicraft/openobject-addons/trunk-stock-picking-location-context
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Needs Fixing
Review via email: mp+95503@code.launchpad.net

Description of the change

Pass location_id in context to load in stock available in location selected.

To post a comment you must log in.
Revision history for this message
Cristian Salamea (ovnicraft) wrote :

Please test this cases:

In web client, click on folder button to see: Create, Search options, select Search options and context is passed and function qty_available for products works ok, but click on combo and select Search More ... and context is lost.

I will report a bug for this, but you can check it with my proposal.

Revision history for this message
Numérigraphe (numerigraphe) wrote :

Hi,
Have you reported this as a bug yet?
If so, linking it to your branch may help bring more attention to your proposal.
Lionel Sausin.

Revision history for this message
Cristian Salamea (ovnicraft) wrote :
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hi Cristian,

It's an interesting feature suggestion, though I feel it might be confusing and counter-intuitive for users.

If you update your branch with the latest trunk, you'll see that the stock.move views have changed a lot, and the emphasis is on presenting clearly the pre-filled pickings/moves that are created by the system (it is much more common than creating picking manually from scratch). Moving the location/location_dest fields on the top of the forms is not an option, it will disrupt the layout and usability.

We could still apply your context patch, but I think it will be confusing because it's not obvious why the stock levels are modified. I'm also not sure users often use the quantity on hand when selecting products to move. And even if they did, having to repeatedly open and close the "search pop-up" to change the "source location" until you find the right location is not a very user-friendly solution, don't you think? No-one will think of doing that, or find it efficient to work, will they?
BTW there are other alternatives for finding locations where the product is available before creating the picking, in a more user-friendly manner.

If you insist on doing this patch, could you ask for feedback to the community, to make sure people would not consider it more confusing than useful? And in any case, please double-check your patch against the new v7 views (and be careful about inherited views which may replace the product_id field and not preserve your context)

Sorry for the conflicts caused by the long review delay...
Thanks!

review: Needs Fixing

Unmerged revisions

6655. By Cristian Salamea

[IMP] pass context in product for load stock by location

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/stock_view.xml'
2--- stock/stock_view.xml 2012-02-13 15:27:55 +0000
3+++ stock/stock_view.xml 2012-03-02 04:07:21 +0000
4@@ -742,10 +742,16 @@
5 <field name="state"/>
6 </tree>
7 <form string="Stock Moves">
8+ <group colspan="2" col="2">
9+ <separator string="Locations" colspan="2" />
10+ <field name="location_id" domain="[('usage','&lt;&gt;','view')]" />
11+ <field name="location_dest_id" domain="[('usage','=','internal')]" />
12+ </group>
13+
14 <group colspan="2" col="4">
15 <separator colspan="4" string="Move Information"/>
16 <field name="name" invisible="1" colspan="4"/>
17- <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)" colspan="4"/>
18+ <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)" colspan="4" context="{'location': location_id}"/>
19 <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" colspan="3"/>
20 <button name="%(stock.move_scrap)d"
21 string="Scrap" type="action" groups="base.group_extended"
22@@ -757,11 +763,6 @@
23 <field groups="base.group_extended" name="product_packaging" domain="[('product_id','=',product_id)]" colspan="4"/>
24 </group>
25
26- <group colspan="2" col="2">
27- <separator string="Locations" colspan="2" />
28- <field name="location_id" domain="[('usage','&lt;&gt;','view')]" />
29- <field name="location_dest_id" domain="[('usage','=','internal')]" />
30- </group>
31
32 <group colspan="2" col="2">
33 <separator string="Dates" colspan="2" />
34@@ -933,10 +934,16 @@
35 <button name="%(action_partial_move_server)d" string="Process" type="action" states="confirmed,assigned" icon="gtk-go-forward"/>
36 </tree>
37 <form string="Stock Moves">
38+ <group colspan="2" col="2">
39+ <separator string="Locations" colspan="2" />
40+ <field name="location_id" domain="[('usage','=','internal')]" />
41+ <field name="location_dest_id" domain="[('usage','&lt;&gt;','view')]" />
42+ </group>
43+
44 <group colspan="2" col="4">
45 <separator colspan="4" string="Move Information"/>
46 <field name="name" invisible="1" colspan="4" />
47- <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)" colspan="4" />
48+ <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)" colspan="4" context="{'location': location_id}"/>
49 <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" colspan="3" />
50 <button name="%(stock.move_scrap)d"
51 string="Scrap" type="action"
52@@ -948,11 +955,6 @@
53 <field groups="base.group_extended" name="product_packaging" domain="[('product_id','=',product_id)]" colspan="4" />
54 </group>
55
56- <group colspan="2" col="2">
57- <separator string="Locations" colspan="2" />
58- <field name="location_id" domain="[('usage','=','internal')]" />
59- <field name="location_dest_id" domain="[('usage','&lt;&gt;','view')]" />
60- </group>
61
62 <group colspan="2" col="2">
63 <separator string="Dates" colspan="2" />
64@@ -1153,10 +1155,16 @@
65 <field name="state"/>
66 </tree>
67 <form string="Stock Moves">
68+ <group colspan="2" col="2">
69+ <separator string="Locations" colspan="2" />
70+ <field name="location_id" domain="[('usage','&lt;&gt;','view')]" />
71+ <field name="location_dest_id" domain="[('usage','=','internal')]" />
72+ </group>
73+
74 <group colspan="2" col="4">
75 <separator colspan="4" string="Move Information"/>
76 <field name="name" invisible="1" colspan="4"/>
77- <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)" colspan="4"/>
78+ <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)" colspan="4" context="{'location': location_id}"/>
79 <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" colspan="3"/>
80 <button name="%(stock.move_scrap)d"
81 string="Scrap" type="action" groups="base.group_extended"
82@@ -1168,11 +1176,6 @@
83 <field groups="base.group_extended" name="product_packaging" domain="[('product_id','=',product_id)]" colspan="4"/>
84 </group>
85
86- <group colspan="2" col="2">
87- <separator string="Locations" colspan="2" />
88- <field name="location_id" domain="[('usage','&lt;&gt;','view')]" />
89- <field name="location_dest_id" domain="[('usage','=','internal')]" />
90- </group>
91
92 <group colspan="2" col="2">
93 <separator string="Dates" colspan="2" />

Subscribers

People subscribed via source and target branches

to all changes: