[IMP] search view: assert the view received from the fields_view_get is a search view

bzr revid: xmo@openerp.com-20111114123948-inqtk10u1xgk2gmg
This commit is contained in:
Xavier Morel 2011-11-14 13:39:48 +01:00
parent ba414a3349
commit fc2050fef1
1 changed files with 6 additions and 0 deletions

View File

@ -135,6 +135,12 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search
}
},
on_loaded: function(data) {
if (data.fields_view.type !== 'search' ||
data.fields_view.arch.tag !== 'search') {
throw new Error(_.sprintf(
"Got non-search view after asking for a search view: type %s, arch root %s",
data.fields_view.type, data.fields_view.arch.tag));
}
var self = this,
lines = this.make_widgets(
data.fields_view['arch'].children,