web 6.0: form_evalExpr fail on complex expression (patch provided)
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'
<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.
Hello,
This issue was already fix in trunk branch with following revision information.
4507 <email address hidden>
Thank You.