← Back to team overview

openerp-dev-web team mailing list archive

[Bug 709409] [NEW] [trunk 4481] error on evaluate attrs in web-client

 

Devishree Brahmbhatt (OpenERP) (dbr-openerp) has assigned this bug to you for OpenERP Web Client:

To reproduce the problem, create a view with that in

<field string="First mode" name="contact_setting1" readonly="1"/>
	<field string="Secondary mode" name="contact_setting2" readonly="1" />
	<group string="Phone" attrs="{'invisible':[('contact_setting1', '!=', '1'),('contact_setting2', '!=', '1')]}">

Problem come from : addons/openerp/static/javascript/form_state.js


function form_evalExpr(prefix, expr, ref_elem) {

    var stack = [];
    for (var i = 0; i < expr.length; i++) {

        var ex = expr[i];
		
        var elem;     <===== where 2 condiction on the list, elem need to be reset to null between each

        if (ref_elem.parents('table.grid').length) {
            var parent = ref_elem.parents('tr.grid-row');
            elem = parent.find(idSelector(prefix + ex[0]));
        }
        if (!elem || !elem.length) {    <======   If cant find elem on the previous if for the second contidition, then second condition 
            elem = jQuery(idSelector(prefix + ex[0]));          <========== use the elem of the fist condition
        }

Patch

change 
var elem;
by
var elem = null;


I hope i'm clear

** Affects: openobject-client-web
     Importance: Low
     Assignee: OpenERP SA's Web Client R&D (openerp-dev-web)
         Status: Confirmed

-- 
[trunk 4481] error on evaluate attrs in web-client
https://bugs.launchpad.net/bugs/709409
You received this bug notification because you are a member of OpenERP SA's Web Client R&D, which is a bug assignee.