Review: Disapprove
Hello,
I have reviewed your merge proposal, and it's too much code.
I think you can just apply below patch with new proposal, do not forget to test.
You also get the 'o2m_id' from the cherrypy.request.terp_params.
So check with cherrypy.request.terp_params.id or
cherrypy.request.terp_params.o2m_id.
+++ addons/openerp/widgets/form/_form.py 2011-09-22 13:04:20 +0000
@@ -623,7 +623,7 @@
class Button(TinyInputWidget):
template = "/openerp/widgets/form/templates/button.mako"
- params = ["btype", "id", "confirm", "icon", "target", "context",
"default_focus"]
+ params = ["btype", "id", "confirm", "icon", "target", "context",
"default_focus", "readonly"]
visible = True
def __init__(self, **attrs):
@@ -631,7 +631,8 @@
# remove mnemonic
self.string = re.sub('_(?!_)', '', self.string or '')
-
+ if (getattr(cherrypy.request, 'terp_params', {}) and
(cherrypy.request.terp_params.id == None)):
+ self.readonly = True
--
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-bug-6179-msh/+merge/68641
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-client-web/6.0-bug-6179-msh.
_______________________________________________
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