← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 771708] [NEW] web 6.0: client does not respect readonly=True on field if inside a <group/>

 

Public bug reported:

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;
} 
...

** Affects: openobject-client-web
     Importance: Undecided
         Status: New

-- 
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:
  New

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;
  } 
  ...


Follow ups

References