[IMP] added warning messages in o2m when using an unsupported type of view, also removed form view handling in o2m

bzr revid: nicolas.vanhoren@openerp.com-20120611160729-wtqg0o0ry12pyi04
This commit is contained in:
niv-openerp 2012-06-11 18:07:29 +02:00
parent 1ddac412b7
commit d369945699
1 changed files with 5 additions and 1 deletions

View File

@ -2737,7 +2737,6 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
this.dataset.o2m = this;
this.dataset.parent_view = this.view;
this.dataset.child_name = this.name;
//this.dataset.child_name =
this.dataset.on_change.add_last(function() {
self.trigger_on_change();
});
@ -2769,6 +2768,11 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
modes = !!modes ? modes.split(",") : ["tree"];
var views = [];
_.each(modes, function(mode) {
if (! _.include(["list", "tree", "graph", "kanban"], mode)) {
instance.webclient.notification.warn(
_.str.sprintf("View type '%s' is not supported in One2Many.", mode));
return;
}
var view = {
view_id: false,
view_type: mode == "tree" ? "list" : mode,