** Changed in: openobject-client-web
   Importance: Undecided => Medium

** Changed in: openobject-client-web
     Assignee: (unassigned) => OpenERP SA's Web Client R&D (openerp-dev-web)

-- 
You received this bug notification because you are a member of OpenERP
SA's Web Client R&D, which is a bug assignee.
https://bugs.launchpad.net/bugs/701092

Title:
  [trunk version 4281] attrs invisible with a contidion on a selection, dont 
work

Status in OpenObject Web Client:
  Confirmed

Bug description:
  To see the error

Create 2 fields, field1 and field2

Field 2 is a selection on what you want

Field 1 visible only is a selection is make in field 2

EX : attrs="{'invisible':[('field2','=',False)]}"

In addons/openerp/static/javascript
function form_evalExpr

line 200

var elem_value = elem.attr('value') || elem.text();

after my trace i see, when we select noting, value is empty but elem.text 
return text of first element, so elem_value never empty

i have no time to make a good patch, so i do a little fast patch for my test

        var elem_value = elem.attr('value') || elem.text();

                if (elem[0] == '[object HTMLSelectElement]'){
                        if (elem.attr('value') == "") {
                                elem_value = 0;
                        }
                }

So if the element is a select and is the value is empty, change the elem_value 
to 0, this change work, but i think is not the best, i let you found a better 
way to do it.


This bug is important for me, because at the moment user can see field when he 
not supposed to see it.

Thank



_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-web
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-web
More help   : https://help.launchpad.net/ListHelp

Reply via email to