Mohammed Shekha(Open ERP) has proposed merging 
lp:~openerp-dev/openobject-client-web/6.0-opw-383670-msh into 
lp:openobject-client-web.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-383670-msh/+merge/93401

Hello,

Fixed the issue of button not shown one2many listgrid of mrp.production form 
view.

Demo :- Manufacturing -> Manufacturing orders -> open any record in form view, 
there is one2many field move_line, which have buttons which are not shown in 
listgrid.

Reason :- Buttons are shown based on state and here state field in one2many is 
hidden(i.e. invisible="1"), so it will have Hidden class in data, and Hidden 
class doesn't have value attribute, which we are trying to fetch through line 
629 of listgrid.py of widget, so this line will creates exception and except 
will assign "Hidden" as value in state, again this is going to check in 
self.states(line no. 632 of listgrid.py of widgets), so here visible=False will 
be passed and button will not be shown.

Hence checked whether the state is instance of Hidden class, if yes then we 
will call get_value method of that widget.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-383670-msh/+merge/93401
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client-web/6.0-opw-383670-msh.
=== modified file 'addons/openerp/widgets/listgrid.py'
--- addons/openerp/widgets/listgrid.py	2012-01-06 11:29:16 +0000
+++ addons/openerp/widgets/listgrid.py	2012-02-16 13:43:22 +0000
@@ -626,7 +626,10 @@
         if self.states:
             state = data.get('state')
             try:
-                state = ((state or False) and state.value) or 'draft'
+                if isinstance(state, Hidden):
+                    state = state.widget.get_value()
+                else:
+                    state = ((state or False) and state.value) or 'draft'
             except:
                 state = ustr(state)
             visible = state in self.states

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to