web 6.0: form_evalExpr fail on complex expression (patch provided)

Bug #771700 reported by Xavier ALT
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web Client
Status tracked in 6.0
6.0
Fix Released
Low
OpenERP Publisher's Warranty Team

Bug Description

Steps to reproduce the problem:

take a object with a view like this:

<group attrs="{'readonly': ['|', ('version','>',1),('state','!=','draft')]}">
  <field name="version"/>
</group>
<field name="state"/>

- state: is a selection field with a default value of "draft"
- version: is an integer field with a default value of 1

When creating this kind of object, the group will appear readonly on the web client, which is wrong.

After digging into the javascript, following are the operations the form_evalExpr perform:

1. push "|" to the stack
2. compare version_value > 1
3. compare version_value != 'draft'
4. evaluate the or and return the result

The problem apprea on step 3., the "elem" variable is not reinitialized on each loop, so is compare with the value of the widget found in previous step (2.), see patch attached for a one line fix.

Revision history for this message
Xavier ALT (dex-phx) wrote :
Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Hello,

This issue was already fix in trunk branch with following revision information.
4507 <email address hidden>

Thank You.

Changed in openobject-client-web:
status: New → Fix Released
Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Thanks for reporting!....

Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello Xavier ALT (Thamini),

Its fixed in stable with the following revision. You can update your code.

Revision-info:
4575 <email address hidden>

Thanks for reporting.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.