Merge lp:~numerigraphe/openobject-addons/trunk-stock-editable-compatible-picking-line into lp:openobject-addons
- trunk-stock-editable-compatible-picking-line
- Merge into trunk
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Core Team | Pending | ||
Review via email: mp+95365@code.launchpad.net |
Commit message
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.
Cristian Salamea (ovnicraft) wrote : | # |
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.
Cristian Salamea (ovnicraft) wrote : | # |
Ok i will make another proposal.
Thanks Lionel
Cristian Salamea (ovnicraft) wrote : | # |
Hello Lionel, i did here: https:/
Regards,
Antony Lesuisse (OpenERP) (al-openerp) wrote : | # |
the view is completely reworked, merge trunk and resubmit if you feel it's still needed.
Preview Diff
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 | 710 | <page string="Products"> | 710 | <page string="Products"> |
6 | 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}"> |
7 | 712 | <tree colors="grey:scrapped == True" string="Stock Moves"> | 712 | <tree colors="grey:scrapped == True" string="Stock Moves"> |
9 | 713 | <field name="product_id"/> | 713 | <field name="name" invisible="1"/> |
10 | 714 | <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)"/> | ||
11 | 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)"/> |
12 | 715 | <field name="product_uom" string="UoM"/> | 716 | <field name="product_uom" string="UoM"/> |
13 | 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"/> | ||
14 | 716 | <field name="product_uos" groups="product.group_uos"/> | 718 | <field name="product_uos" groups="product.group_uos"/> |
15 | 717 | <button name="%(stock.move_scrap)d" | 719 | <button name="%(stock.move_scrap)d" |
16 | 718 | string="Scrap Products" type="action" | 720 | string="Scrap Products" type="action" |
17 | @@ -720,7 +722,10 @@ | |||
18 | 720 | states="draft,waiting,confirmed,assigned" | 722 | states="draft,waiting,confirmed,assigned" |
19 | 721 | groups="base.group_extended"/> | 723 | groups="base.group_extended"/> |
20 | 722 | <field name="scrapped" invisible="1"/> | 724 | <field name="scrapped" invisible="1"/> |
22 | 723 | <field name="prodlot_id" groups="base.group_extended"/> | 725 | <field name="prodlot_id" groups="base.group_extended" |
23 | 726 | context="{'location_id':location_id, 'product_id':product_id}" | ||
24 | 727 | domain="[('product_id','=?',product_id)]" | ||
25 | 728 | on_change="onchange_lot_id(prodlot_id, product_qty, location_id, product_id, product_uom)"/> | ||
26 | 724 | <button | 729 | <button |
27 | 725 | name="%(stock.track_line)d" | 730 | name="%(stock.track_line)d" |
28 | 726 | string="Split in production lots" | 731 | string="Split in production lots" |
29 | @@ -737,7 +742,8 @@ | |||
30 | 737 | groups="base.group_extended" | 742 | groups="base.group_extended" |
31 | 738 | icon="terp-stock_effects-object-colorize" | 743 | icon="terp-stock_effects-object-colorize" |
32 | 739 | states="draft,assigned,confirmed"/> | 744 | states="draft,assigned,confirmed"/> |
34 | 740 | <field name="location_dest_id"/> | 745 | <field name="location_id" domain="[('usage','<>','view')]"/> |
35 | 746 | <field name="location_dest_id" domain="[('usage','=','internal')]"/> | ||
36 | 741 | <field name="date_expected" string="Date Expected"/> | 747 | <field name="date_expected" string="Date Expected"/> |
37 | 742 | <field name="state"/> | 748 | <field name="state"/> |
38 | 743 | </tree> | 749 | </tree> |
39 | @@ -903,16 +909,21 @@ | |||
40 | 903 | <page string="Products"> | 909 | <page string="Products"> |
41 | 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}" > |
42 | 905 | <tree colors="grey:scrapped==True" string="Stock Moves"> | 911 | <tree colors="grey:scrapped==True" string="Stock Moves"> |
44 | 906 | <field name="product_id"/> | 912 | <field name="name" invisible="1"/> |
45 | 913 | <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)"/> | ||
46 | 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)"/> |
47 | 908 | <field name="product_uom" string="UoM"/> | 915 | <field name="product_uom" string="UoM"/> |
48 | 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"/> | ||
49 | 909 | <field name="product_uos" groups="product.group_uos"/> | 917 | <field name="product_uos" groups="product.group_uos"/> |
50 | 910 | <button name="%(stock.move_scrap)d" | 918 | <button name="%(stock.move_scrap)d" |
51 | 911 | string="Scrap Products" type="action" | 919 | string="Scrap Products" type="action" |
52 | 912 | icon="gtk-convert" context="{'scrap': True}" | 920 | icon="gtk-convert" context="{'scrap': True}" |
53 | 913 | states="draft,waiting,confirmed,assigned" /> | 921 | states="draft,waiting,confirmed,assigned" /> |
54 | 914 | <field name="scrapped" invisible="1"/> | 922 | <field name="scrapped" invisible="1"/> |
56 | 915 | <field name="prodlot_id" groups="base.group_extended"/> | 923 | <field name="prodlot_id" groups="base.group_extended" |
57 | 924 | context="{'location_id':location_id, 'product_id':product_id}" | ||
58 | 925 | domain="[('product_id','=?',product_id)]" | ||
59 | 926 | on_change="onchange_lot_id(prodlot_id, product_qty, location_id, product_id, product_uom)"/> | ||
60 | 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" |
61 | 917 | icon="terp-stock_effects-object-colorize" attrs="{'invisible': [('prodlot_id','<>',False)]}" | 928 | icon="terp-stock_effects-object-colorize" attrs="{'invisible': [('prodlot_id','<>',False)]}" |
62 | 918 | states="draft,assigned,confirmed" | 929 | states="draft,assigned,confirmed" |
63 | @@ -927,7 +938,8 @@ | |||
64 | 927 | icon="terp-stock_effects-object-colorize" | 938 | icon="terp-stock_effects-object-colorize" |
65 | 928 | groups="base.group_extended" | 939 | groups="base.group_extended" |
66 | 929 | states="draft,assigned,confirmed"/> | 940 | states="draft,assigned,confirmed"/> |
68 | 930 | <field name="location_id"/> | 941 | <field name="location_id" domain="[('usage','=','internal')]" /> |
69 | 942 | <field name="location_dest_id" domain="[('usage','<>','view')]" invisible="1"/> | ||
70 | 931 | <field name="date"/> | 943 | <field name="date"/> |
71 | 932 | <field name="state"/> | 944 | <field name="state"/> |
72 | 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"/> |
73 | @@ -1124,16 +1136,22 @@ | |||
74 | 1124 | <page string="General Information"> | 1136 | <page string="General Information"> |
75 | 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}" > |
76 | 1126 | <tree colors="grey:scrapped==True" string="Stock Moves"> | 1138 | <tree colors="grey:scrapped==True" string="Stock Moves"> |
79 | 1127 | <field name="product_id" /> | 1139 | <field name="name" invisible="1"/> |
80 | 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)"/> |
81 | 1141 | <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/> | ||
82 | 1129 | <field name="product_uom" string="UoM" /> | 1142 | <field name="product_uom" string="UoM" /> |
83 | 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"/> | ||
84 | 1144 | <field name="product_uos" groups="product.group_uos" invisible="1"/> | ||
85 | 1130 | <button name="%(stock.move_scrap)d" | 1145 | <button name="%(stock.move_scrap)d" |
86 | 1131 | string="Scrap Products" type="action" | 1146 | string="Scrap Products" type="action" |
87 | 1132 | icon="gtk-convert" context="{'scrap': True}" | 1147 | icon="gtk-convert" context="{'scrap': True}" |
88 | 1133 | states="draft,waiting,confirmed,assigned" | 1148 | states="draft,waiting,confirmed,assigned" |
89 | 1134 | groups="base.group_extended"/> | 1149 | groups="base.group_extended"/> |
90 | 1135 | <field name="scrapped" invisible="1"/> | 1150 | <field name="scrapped" invisible="1"/> |
92 | 1136 | <field name="prodlot_id" groups="base.group_extended"/> | 1151 | <field name="prodlot_id" groups="base.group_extended" |
93 | 1152 | context="{'location_id':location_id, 'product_id':product_id}" | ||
94 | 1153 | domain="[('product_id','=?',product_id)]" | ||
95 | 1154 | on_change="onchange_lot_id(prodlot_id, product_qty, location_id, product_id, product_uom)"/> | ||
96 | 1137 | <button | 1155 | <button |
97 | 1138 | name="%(stock.track_line)d" | 1156 | name="%(stock.track_line)d" |
98 | 1139 | string="Split in production lots" | 1157 | string="Split in production lots" |
99 | @@ -1149,7 +1167,8 @@ | |||
100 | 1149 | groups="base.group_extended" | 1167 | groups="base.group_extended" |
101 | 1150 | icon="terp-stock_effects-object-colorize" | 1168 | icon="terp-stock_effects-object-colorize" |
102 | 1151 | states="draft,assigned,confirmed"/> | 1169 | states="draft,assigned,confirmed"/> |
104 | 1152 | <field name="location_dest_id"/> | 1170 | <field name="location_id" domain="[('usage','<>','view')]" invisible="1"/> |
105 | 1171 | <field name="location_dest_id" domain="[('usage','=','internal')]"/> | ||
106 | 1153 | <field name="state"/> | 1172 | <field name="state"/> |
107 | 1154 | </tree> | 1173 | </tree> |
108 | 1155 | <form string="Stock Moves"> | 1174 | <form string="Stock Moves"> |
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 ?