← Back to team overview

c2c-oerpscenario team mailing list archive

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

 

Public bug reported:

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: 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/709409

Title:
  [truck 4481] error on evaluate attrs in web-client

Status in OpenERP Web Client:
  New

Bug description:
  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





Follow ups

References