c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #22797
[Bug 771708] Re: web 6.0: client does not respect readonly=True on field if inside a <group/>
** Changed in: openobject-client-web
Status: New => Incomplete
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/771708
Title:
web 6.0: client does not respect readonly=True on field if inside a
<group/>
Status in OpenERP Web Client:
Incomplete
Bug description:
Versions:
Server: 6.0.2
Client Web: 6.0.2
Steps to reproduce the problem:
When defining a view like this:
<group>
<field name="version" readonly="1"/>
<field name="reference" readonly="1"/>
</group>
- version: is an integer field
- reference: is a char field
The rendered code the the browser is ok, the two field get class with "readonlyfield" set.
But then, when the javascript checks the attrs on the "group" element, it force the readonly attribute to False to *all* elements inside the group, and so remove the "readonlyfield" class on all input element.
See function form_setReadonly() in
addons/openerp/static/javascript/form_state.js
... snip line 277...
if (!type && ($field.hasClass('item-group'))) {
jQuery($field).find(':input')
.toggleClass('readonlyfield', readonly)
.attr({'disabled': readonly, 'readOnly': readonly});
return;
}
...
References