diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 45e38743ba5..5505cd16fe0 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3371,7 +3371,7 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ var def = $.Deferred().then(function() { self.initial_is_loaded.resolve(); }); - this.viewmanager.on_controller_inited.add_last(function(view_type, controller) { + this.viewmanager.on("controller_inited", self, function(view_type, controller) { controller.o2m = self; if (view_type == "list") { if (self.get("effective_readonly")) { diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 5f90c4215f7..47a06e37ddc 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -532,12 +532,12 @@ instance.web.ViewManager = instance.web.Widget.extend({ this.views[view_type].controller = controller; this.views[view_type].deferred.resolve(view_type); return $.when(view_promise).then(function() { - self.on_controller_inited(view_type, controller); if (self.searchview && self.flags.auto_search && view.controller.searchable !== false) { self.searchview.ready.then(self.searchview.do_search); } + self.trigger("controller_inited",view_type,controller); }); }, set_title: function(title) { @@ -652,14 +652,6 @@ instance.web.ViewManager = instance.web.Widget.extend({ controller.do_search(results.domain, results.context, groupby || []); }); }, - /** - * Event launched when a controller has been inited. - * - * @param {String} view_type type of view - * @param {String} view the inited controller - */ - on_controller_inited: function(view_type, view) { - }, /** * Called when one of the view want to execute an action */