From d369945699f19faec36a27fd3954c34bce8bae8a Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 11 Jun 2012 18:07:29 +0200 Subject: [PATCH] [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 --- addons/web/static/src/js/view_form.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 2a858a6df4e..836bfff7ec5 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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,