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

Requested reviews:
  OpenERP Core Team (openerp)

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

Hello,

To face the issue go to any one2many which has button, create new record in 
one2many at that time buttons in one2many will be enable which is not a proper 
behavior.

Buttons should be readonly when there is a new record and it should be enable 
if and only if the record is already saved.

So changed the code of Button Widget, I have put a condition that if there o2m 
in cherrypy.request.terp_param and cherrypy.request.params has no o2m_id then i 
have created buttons readonly.

Thanks.

-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-6179-msh/+merge/76716
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client-web/6.0-opw-6179-msh.
=== modified file 'addons/openerp/widgets/form/_form.py'
--- addons/openerp/widgets/form/_form.py	2011-07-18 09:36:24 +0000
+++ addons/openerp/widgets/form/_form.py	2011-09-23 11:40:38 +0000
@@ -632,6 +632,9 @@
         # remove mnemonic
         self.string = re.sub('_(?!_)', '', self.string or '')
 
+        if (getattr(cherrypy.request, 'terp_params', {}) and 
+            cherrypy.request.terp_params.o2m and not cherrypy.request.terp_params.o2m_id):
+            self.readonly = True
         self.btype = attrs.get('special', attrs.get('type', 'workflow'))
         self.context = attrs.get("context", {})
         self.nolabel = True

_______________________________________________
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