Merge lp:~numerigraphe/openobject-addons/trunk-stock-editable-compatible-picking-line into lp:openobject-addons

Proposed by Numérigraphe
Status: Rejected
Rejected by: Antony Lesuisse (OpenERP)
Proposed branch: lp:~numerigraphe/openobject-addons/trunk-stock-editable-compatible-picking-line
Merge into: lp:openobject-addons
Diff against target: 108 lines (+29/-10)
1 file modified
stock/stock_view.xml (+29/-10)
To merge this branch: bzr merge lp:~numerigraphe/openobject-addons/trunk-stock-editable-compatible-picking-line
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+95365@code.launchpad.net

Description of the change

In the 3 picking forms, the o2m tree view of the products are not editable, but they contain most of what it takes to be compatible with editable lists.
I propose to add the missing fieds and onchange calls to make completly compatible.
This way, an additional module would only have to add the "editable" attribute to the o2m treeviews to make them editable and not break the whole system.
Lionel Sausin.

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

Hello, i get a suggestion to improve, pass in context for product the location_id

like.

<field name="product_id" context="{'location': location_id}"/>

As we know qty_available is compute based in params from context, so if we are moving from location_id to location_dest_id is better for user just see inventory in that location source.

What is your opinion ?

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

Dear Cristian Salamea,
Thanks for your comment. I agree that would be logical, but would be required on both o2m form views and o2m tree views.
To keep the patch clean and tight I've only copied/pasted the missing attributes and fields from the o2m form views. So it would be best done in another proposal. Would you care to make one?
Lionel.

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

Ok i will make another proposal.

Thanks Lionel

Revision history for this message
Cristian Salamea (ovnicraft) wrote :
Revision history for this message
Antony Lesuisse (OpenERP) (al-openerp) wrote :

the view is completely reworked, merge trunk and resubmit if you feel it's still needed.

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 11:31:25 +0000
4@@ -710,9 +710,11 @@
5 <page string="Products">
6 <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_in_id': address_id}">
7 <tree colors="grey:scrapped == True" string="Stock Moves">
8- <field name="product_id"/>
9+ <field name="name" invisible="1"/>
10+ <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)"/>
11 <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
12 <field name="product_uom" string="UoM"/>
13+ <field name="product_uos_qty" groups="product.group_uos" on_change="onchange_uos_quantity(product_id, product_uos_qty, product_uos, product_uom)" invisible="1"/>
14 <field name="product_uos" groups="product.group_uos"/>
15 <button name="%(stock.move_scrap)d"
16 string="Scrap Products" type="action"
17@@ -720,7 +722,10 @@
18 states="draft,waiting,confirmed,assigned"
19 groups="base.group_extended"/>
20 <field name="scrapped" invisible="1"/>
21- <field name="prodlot_id" groups="base.group_extended"/>
22+ <field name="prodlot_id" groups="base.group_extended"
23+ context="{'location_id':location_id, 'product_id':product_id}"
24+ domain="[('product_id','=?',product_id)]"
25+ on_change="onchange_lot_id(prodlot_id, product_qty, location_id, product_id, product_uom)"/>
26 <button
27 name="%(stock.track_line)d"
28 string="Split in production lots"
29@@ -737,7 +742,8 @@
30 groups="base.group_extended"
31 icon="terp-stock_effects-object-colorize"
32 states="draft,assigned,confirmed"/>
33- <field name="location_dest_id"/>
34+ <field name="location_id" domain="[('usage','&lt;&gt;','view')]"/>
35+ <field name="location_dest_id" domain="[('usage','=','internal')]"/>
36 <field name="date_expected" string="Date Expected"/>
37 <field name="state"/>
38 </tree>
39@@ -903,16 +909,21 @@
40 <page string="Products">
41 <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_out_id': address_id, 'picking_type': type}" >
42 <tree colors="grey:scrapped==True" string="Stock Moves">
43- <field name="product_id"/>
44+ <field name="name" invisible="1"/>
45+ <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)"/>
46 <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
47 <field name="product_uom" string="UoM"/>
48+ <field name="product_uos_qty" groups="product.group_uos" on_change="onchange_uos_quantity(product_id, product_uos_qty, product_uos, product_uom)" invisible="1"/>
49 <field name="product_uos" groups="product.group_uos"/>
50 <button name="%(stock.move_scrap)d"
51 string="Scrap Products" type="action"
52 icon="gtk-convert" context="{'scrap': True}"
53 states="draft,waiting,confirmed,assigned" />
54 <field name="scrapped" invisible="1"/>
55- <field name="prodlot_id" groups="base.group_extended"/>
56+ <field name="prodlot_id" groups="base.group_extended"
57+ context="{'location_id':location_id, 'product_id':product_id}"
58+ domain="[('product_id','=?',product_id)]"
59+ on_change="onchange_lot_id(prodlot_id, product_qty, location_id, product_id, product_uom)"/>
60 <button name="%(track_line)d" string="Split in production lots" type="action"
61 icon="terp-stock_effects-object-colorize" attrs="{'invisible': [('prodlot_id','&lt;&gt;',False)]}"
62 states="draft,assigned,confirmed"
63@@ -927,7 +938,8 @@
64 icon="terp-stock_effects-object-colorize"
65 groups="base.group_extended"
66 states="draft,assigned,confirmed"/>
67- <field name="location_id"/>
68+ <field name="location_id" domain="[('usage','=','internal')]" />
69+ <field name="location_dest_id" domain="[('usage','&lt;&gt;','view')]" invisible="1"/>
70 <field name="date"/>
71 <field name="state"/>
72 <button name="%(action_partial_move_server)d" string="Process" type="action" states="confirmed,assigned" icon="gtk-go-forward"/>
73@@ -1124,16 +1136,22 @@
74 <page string="General Information">
75 <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_in_id': address_id, 'picking_type': type}" >
76 <tree colors="grey:scrapped==True" string="Stock Moves">
77- <field name="product_id" />
78- <field name="product_qty" />
79+ <field name="name" invisible="1"/>
80+ <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)"/>
81+ <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
82 <field name="product_uom" string="UoM" />
83+ <field name="product_uos_qty" groups="product.group_uos" on_change="onchange_uos_quantity(product_id, product_uos_qty, product_uos, product_uom)" invisible="1"/>
84+ <field name="product_uos" groups="product.group_uos" invisible="1"/>
85 <button name="%(stock.move_scrap)d"
86 string="Scrap Products" type="action"
87 icon="gtk-convert" context="{'scrap': True}"
88 states="draft,waiting,confirmed,assigned"
89 groups="base.group_extended"/>
90 <field name="scrapped" invisible="1"/>
91- <field name="prodlot_id" groups="base.group_extended"/>
92+ <field name="prodlot_id" groups="base.group_extended"
93+ context="{'location_id':location_id, 'product_id':product_id}"
94+ domain="[('product_id','=?',product_id)]"
95+ on_change="onchange_lot_id(prodlot_id, product_qty, location_id, product_id, product_uom)"/>
96 <button
97 name="%(stock.track_line)d"
98 string="Split in production lots"
99@@ -1149,7 +1167,8 @@
100 groups="base.group_extended"
101 icon="terp-stock_effects-object-colorize"
102 states="draft,assigned,confirmed"/>
103- <field name="location_dest_id"/>
104+ <field name="location_id" domain="[('usage','&lt;&gt;','view')]" invisible="1"/>
105+ <field name="location_dest_id" domain="[('usage','=','internal')]"/>
106 <field name="state"/>
107 </tree>
108 <form string="Stock Moves">

Subscribers

People subscribed via source and target branches

to all changes: