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
=== modified file 'stock/stock_view.xml'
--- stock/stock_view.xml 2012-02-13 15:27:55 +0000
+++ stock/stock_view.xml 2012-03-02 11:31:25 +0000
@@ -710,9 +710,11 @@
710 <page string="Products">710 <page string="Products">
711 <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_in_id': address_id}">711 <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_in_id': address_id}">
712 <tree colors="grey:scrapped == True" string="Stock Moves">712 <tree colors="grey:scrapped == True" string="Stock Moves">
713 <field name="product_id"/>713 <field name="name" invisible="1"/>
714 <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)"/>
714 <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>715 <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
715 <field name="product_uom" string="UoM"/>716 <field name="product_uom" string="UoM"/>
717 <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"/>
716 <field name="product_uos" groups="product.group_uos"/>718 <field name="product_uos" groups="product.group_uos"/>
717 <button name="%(stock.move_scrap)d"719 <button name="%(stock.move_scrap)d"
718 string="Scrap Products" type="action"720 string="Scrap Products" type="action"
@@ -720,7 +722,10 @@
720 states="draft,waiting,confirmed,assigned"722 states="draft,waiting,confirmed,assigned"
721 groups="base.group_extended"/>723 groups="base.group_extended"/>
722 <field name="scrapped" invisible="1"/>724 <field name="scrapped" invisible="1"/>
723 <field name="prodlot_id" groups="base.group_extended"/>725 <field name="prodlot_id" groups="base.group_extended"
726 context="{'location_id':location_id, 'product_id':product_id}"
727 domain="[('product_id','=?',product_id)]"
728 on_change="onchange_lot_id(prodlot_id, product_qty, location_id, product_id, product_uom)"/>
724 <button729 <button
725 name="%(stock.track_line)d"730 name="%(stock.track_line)d"
726 string="Split in production lots"731 string="Split in production lots"
@@ -737,7 +742,8 @@
737 groups="base.group_extended"742 groups="base.group_extended"
738 icon="terp-stock_effects-object-colorize"743 icon="terp-stock_effects-object-colorize"
739 states="draft,assigned,confirmed"/>744 states="draft,assigned,confirmed"/>
740 <field name="location_dest_id"/>745 <field name="location_id" domain="[('usage','&lt;&gt;','view')]"/>
746 <field name="location_dest_id" domain="[('usage','=','internal')]"/>
741 <field name="date_expected" string="Date Expected"/>747 <field name="date_expected" string="Date Expected"/>
742 <field name="state"/>748 <field name="state"/>
743 </tree>749 </tree>
@@ -903,16 +909,21 @@
903 <page string="Products">909 <page string="Products">
904 <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_out_id': address_id, 'picking_type': type}" >910 <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_out_id': address_id, 'picking_type': type}" >
905 <tree colors="grey:scrapped==True" string="Stock Moves">911 <tree colors="grey:scrapped==True" string="Stock Moves">
906 <field name="product_id"/>912 <field name="name" invisible="1"/>
913 <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)"/>
907 <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>914 <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
908 <field name="product_uom" string="UoM"/>915 <field name="product_uom" string="UoM"/>
916 <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"/>
909 <field name="product_uos" groups="product.group_uos"/>917 <field name="product_uos" groups="product.group_uos"/>
910 <button name="%(stock.move_scrap)d"918 <button name="%(stock.move_scrap)d"
911 string="Scrap Products" type="action"919 string="Scrap Products" type="action"
912 icon="gtk-convert" context="{'scrap': True}"920 icon="gtk-convert" context="{'scrap': True}"
913 states="draft,waiting,confirmed,assigned" />921 states="draft,waiting,confirmed,assigned" />
914 <field name="scrapped" invisible="1"/>922 <field name="scrapped" invisible="1"/>
915 <field name="prodlot_id" groups="base.group_extended"/>923 <field name="prodlot_id" groups="base.group_extended"
924 context="{'location_id':location_id, 'product_id':product_id}"
925 domain="[('product_id','=?',product_id)]"
926 on_change="onchange_lot_id(prodlot_id, product_qty, location_id, product_id, product_uom)"/>
916 <button name="%(track_line)d" string="Split in production lots" type="action"927 <button name="%(track_line)d" string="Split in production lots" type="action"
917 icon="terp-stock_effects-object-colorize" attrs="{'invisible': [('prodlot_id','&lt;&gt;',False)]}"928 icon="terp-stock_effects-object-colorize" attrs="{'invisible': [('prodlot_id','&lt;&gt;',False)]}"
918 states="draft,assigned,confirmed"929 states="draft,assigned,confirmed"
@@ -927,7 +938,8 @@
927 icon="terp-stock_effects-object-colorize"938 icon="terp-stock_effects-object-colorize"
928 groups="base.group_extended"939 groups="base.group_extended"
929 states="draft,assigned,confirmed"/>940 states="draft,assigned,confirmed"/>
930 <field name="location_id"/>941 <field name="location_id" domain="[('usage','=','internal')]" />
942 <field name="location_dest_id" domain="[('usage','&lt;&gt;','view')]" invisible="1"/>
931 <field name="date"/>943 <field name="date"/>
932 <field name="state"/>944 <field name="state"/>
933 <button name="%(action_partial_move_server)d" string="Process" type="action" states="confirmed,assigned" icon="gtk-go-forward"/>945 <button name="%(action_partial_move_server)d" string="Process" type="action" states="confirmed,assigned" icon="gtk-go-forward"/>
@@ -1124,16 +1136,22 @@
1124 <page string="General Information">1136 <page string="General Information">
1125 <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_in_id': address_id, 'picking_type': type}" >1137 <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_in_id': address_id, 'picking_type': type}" >
1126 <tree colors="grey:scrapped==True" string="Stock Moves">1138 <tree colors="grey:scrapped==True" string="Stock Moves">
1127 <field name="product_id" />1139 <field name="name" invisible="1"/>
1128 <field name="product_qty" />1140 <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)"/>
1141 <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
1129 <field name="product_uom" string="UoM" />1142 <field name="product_uom" string="UoM" />
1143 <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"/>
1144 <field name="product_uos" groups="product.group_uos" invisible="1"/>
1130 <button name="%(stock.move_scrap)d"1145 <button name="%(stock.move_scrap)d"
1131 string="Scrap Products" type="action"1146 string="Scrap Products" type="action"
1132 icon="gtk-convert" context="{'scrap': True}"1147 icon="gtk-convert" context="{'scrap': True}"
1133 states="draft,waiting,confirmed,assigned"1148 states="draft,waiting,confirmed,assigned"
1134 groups="base.group_extended"/>1149 groups="base.group_extended"/>
1135 <field name="scrapped" invisible="1"/>1150 <field name="scrapped" invisible="1"/>
1136 <field name="prodlot_id" groups="base.group_extended"/>1151 <field name="prodlot_id" groups="base.group_extended"
1152 context="{'location_id':location_id, 'product_id':product_id}"
1153 domain="[('product_id','=?',product_id)]"
1154 on_change="onchange_lot_id(prodlot_id, product_qty, location_id, product_id, product_uom)"/>
1137 <button1155 <button
1138 name="%(stock.track_line)d"1156 name="%(stock.track_line)d"
1139 string="Split in production lots"1157 string="Split in production lots"
@@ -1149,7 +1167,8 @@
1149 groups="base.group_extended"1167 groups="base.group_extended"
1150 icon="terp-stock_effects-object-colorize"1168 icon="terp-stock_effects-object-colorize"
1151 states="draft,assigned,confirmed"/>1169 states="draft,assigned,confirmed"/>
1152 <field name="location_dest_id"/>1170 <field name="location_id" domain="[('usage','&lt;&gt;','view')]" invisible="1"/>
1171 <field name="location_dest_id" domain="[('usage','=','internal')]"/>
1153 <field name="state"/>1172 <field name="state"/>
1154 </tree>1173 </tree>
1155 <form string="Stock Moves">1174 <form string="Stock Moves">

Subscribers

People subscribed via source and target branches

to all changes: