diff --git a/addons/web/static/src/js/framework/widget.js b/addons/web/static/src/js/framework/widget.js index 6d2a3728ed8..6dbb1294ee7 100644 --- a/addons/web/static/src/js/framework/widget.js +++ b/addons/web/static/src/js/framework/widget.js @@ -352,6 +352,13 @@ var Widget = core.Class.extend(mixins.PropertiesMixin, { do_hide: function () { this.$el.addClass('o_hidden'); }, + do_toggle: function () { + if (this.$el.hasClass('o_hidden')) { + this.do_show(); + } else { + this.do_hide(); + } + }, /** * Proxies a method of the object, in order to keep the right ``this`` on * method invocations. @@ -403,4 +410,4 @@ var Widget = core.Class.extend(mixins.PropertiesMixin, { return Widget; -}); \ No newline at end of file +});