Merge lp:~openerp-dev/openobject-addons/trunk-bug-937077-mma into lp:openobject-addons

Proposed by Mayur Maheshwari(OpenERP)
Status: Rejected
Rejected by: qdp (OpenERP)
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-937077-mma
Merge into: lp:openobject-addons
Diff against target: 12 lines (+1/-1)
1 file modified
stock/stock.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-937077-mma
Reviewer Review Type Date Requested Status
Mayur Maheshwari(OpenERP) (community) Needs Resubmitting
Numérigraphe (community) Disapprove
OpenERP Core Team Pending
Review via email: mp+93933@code.launchpad.net

Description of the change

Hello,

       stock: set type field readonly in done state

Thanks.
mma

To post a comment you must log in.
Revision history for this message
Numérigraphe (numerigraphe) wrote :

As stated in the bug report, this field has to be read-only at all times. If users change it without closing the view it will lead to "wrong" results such as average price not getting updated.

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

Ravish(OpenERP) (rmu-openerp) wrote 1 hour ago: "As you suggested that all field should be read only .But when I want to create picking from "incoming shipment" that time I need all provide selection options.so this fix committed is perfect for now."

This is far from perfect.

First, you don't even need this field displayed at all, because there is a dedicated view and menu entry for each value.
Second, I don't understand why you "need all provide selection options". Functionally it's useless, so is it for technical reasons? In that case, you must allow changes only in the draft state. Users changing confirmed or assigned moves would be very wrong.
Lionel.

review: Disapprove
Revision history for this message
Mayur Maheshwari(OpenERP) (mma-openerp) wrote :

Hello Lionel

        As per above comment I Have Improved type field [read only except draft state]

Thanks.

review: Needs Resubmitting
Revision history for this message
qdp (OpenERP) (qdp) wrote :

well actually this field should be always readonly and set by the domains of menuitems.

I made my own fix that landed in trunk in revision 7132

thanks for the contribution,
Quentin

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/stock.py'
2--- stock/stock.py 2012-02-15 18:00:28 +0000
3+++ stock/stock.py 2012-02-22 07:17:20 +0000
4@@ -616,7 +616,7 @@
5 'name': fields.char('Reference', size=64, select=True),
6 'origin': fields.char('Origin', size=64, help="Reference of the document that produced this picking.", select=True),
7 'backorder_id': fields.many2one('stock.picking', 'Back Order of', help="If this picking was split this field links to the picking that contains the other part that has been processed already.", select=True),
8- 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], 'Shipping Type', required=True, select=True, help="Shipping type specify, goods coming in or going out."),
9+ 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], 'Shipping Type', required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}), help="Shipping type specify, goods coming in or going out."),
10 'note': fields.text('Notes'),
11 'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True),
12 'location_id': fields.many2one('stock.location', 'Location', help="Keep empty if you produce at the location where the finished products are needed." \

Subscribers

People subscribed via source and target branches

to all changes: