[FIX] Fixed a forgotten add(), SearchView#on_invalid().
bzr revid: vta@openerp.com-20121019111558-zu8hzh7u61srew2e
This commit is contained in:
parent
a060b1400b
commit
877957819e
|
@ -746,7 +746,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
||||||
this.on_invalid(search.errors);
|
this.on_invalid(search.errors);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return this.trigger('search_data', search.domains, search.contexts, search.groupbys);
|
this.trigger('search_data', search.domains, search.contexts, search.groupbys);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Triggered after the SearchView has collected all relevant domains and
|
* Triggered after the SearchView has collected all relevant domains and
|
||||||
|
@ -777,6 +777,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
||||||
*/
|
*/
|
||||||
on_invalid: function (errors) {
|
on_invalid: function (errors) {
|
||||||
this.do_notify(_t("Invalid Search"), _t("triggered from search view"));
|
this.do_notify(_t("Invalid Search"), _t("triggered from search view"));
|
||||||
|
this.trigger('invalid_search', errors);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,8 @@ $(document).ready(function () {
|
||||||
|
|
||||||
var dataset = {model: 'dummy.model', get_context: function () { return {}; }};
|
var dataset = {model: 'dummy.model', get_context: function () { return {}; }};
|
||||||
var view = new instance.web.SearchView(null, dataset, false, defaults);
|
var view = new instance.web.SearchView(null, dataset, false, defaults);
|
||||||
view.on_invalid.add(function () {
|
var self = this;
|
||||||
|
view.on('invalid_search', self, function () {
|
||||||
ok(false, JSON.stringify([].slice(arguments)));
|
ok(false, JSON.stringify([].slice(arguments)));
|
||||||
});
|
});
|
||||||
return view;
|
return view;
|
||||||
|
|
Loading…
Reference in New Issue