[IMP] only send domain if there's a value (the field is 'enabled')

bzr revid: xmo@openerp.com-20110324180028-3cuim4glo70wezkh
This commit is contained in:
Xavier Morel 2011-03-24 19:00:28 +01:00
parent 10d34d936a
commit f9e10d85a1
1 changed files with 9 additions and 1 deletions

View File

@ -657,12 +657,20 @@ openerp.base.search.Field = openerp.base.search.Input.extend({
this.filters.start();
},
get_context: function () {
if (!this.attrs.context) {
var val = this.get_value();
// A field needs a value to be "active", and a context to send when
// active
if (!(val && this.attrs.context)) {
return;
}
return this.attrs.context;
},
get_domain: function () {
var val = this.get_value();
if(!val) {
return;
}
if (!this.attrs['filter_domain']) {
return [
this.attrs.name,