[FIX] incorrect clearing of default values on selection fields in search view

and simplification of the same on basic fields

bzr revid: xmo@openerp.com-20120621101009-vg0rnwnitxfhaill
This commit is contained in:
Xavier Morel
2012-06-21 12:10:09 +02:00
+3 -7
View File
@@ -824,14 +824,9 @@ openerp.web.search.Field = openerp.web.search.Input.extend( /** @lends openerp.w
return _.extend({}, domain, {own_values: {self: val}});
},
clear: function () {
if (!this.$element.val()) {
return;
if (this.$element.attr('value') !== undefined) {
this.$element.removeAttr('value');
}
var self = this;
setTimeout(function () {
self.$element.val('');
}, 0);
}
});
/**
@@ -952,6 +947,7 @@ openerp.web.search.SelectionField = openerp.web.search.Field.extend(/** @lends o
return d.promise();
}
}
this.$element.find('option[selected]').removeAttr("selected");
return d.resolve().promise();
}
});