From 7e6d223e9e6e9ba232c9fa2b1e5629563f5e7a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 19 May 2014 14:16:09 +0200 Subject: [PATCH 01/48] [IMP] work on inline search view in web client incomplete work. So far, the search view widget has been split in two widgets: SearchView and SearchViewDrawer. The SearchViewDrawer has been inserted inline, and some preliminary work has been done to improve the layout. --- addons/mail/static/src/js/mail.js | 5 +- addons/mail/static/src/xml/mail.xml | 1 + addons/web/static/src/css/base.css | 5 +- addons/web/static/src/css/base.sass | 4 +- addons/web/static/src/js/search.js | 325 +++++++++++++++------------- addons/web/static/src/js/views.js | 9 +- addons/web/static/src/xml/base.xml | 6 +- 7 files changed, 197 insertions(+), 158 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 99a7751e15e..9cf33203a45 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -1888,7 +1888,10 @@ openerp.mail = function (session) { var self = this; var ds_msg = new session.web.DataSetSearch(this, 'mail.message'); this.searchview = new session.web.SearchView(this, ds_msg, false, defaults || {}, false); - this.searchview.appendTo(this.$('.oe_view_manager_view_search')) + this.searchview_drawer = new session.web.SearchViewDrawer(this, this.searchview); + + $.when(this.searchview.appendTo(this.$('.oe_view_manager_view_search')), + this.searchview_drawer.appendTo(this.$('.oe_searchview_drawer_container'))) .then(function () { self.searchview.on('search_data', self, self.do_searchview_search); }); if (this.searchview.has_defaults) { this.searchview.ready.then(this.searchview.do_search); diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index ec7b0fa2911..77aeef0b5b9 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -191,6 +191,7 @@ +
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index f02dc3c7fd7..03066c171b4 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,4 +1,4 @@ -@charset "utf-8"; +@charset "UTF-8"; @font-face { font-family: "mnmliconsRegular"; src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot"); @@ -1776,6 +1776,9 @@ margin: 0 0 0 4px; padding: 0; } +.openerp .oe_searchview_drawer_container { + border-bottom: 1px solid #afafb6; +} .openerp .oe_view_nocontent { padding: 15px; margin-top: 0; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index c15c90abb7a..e1296924629 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1280,7 +1280,7 @@ $sheet-padding: 16px &.oe_searchview_open_drawer .oe_searchview_drawer display: block - + .oe_searchview_drawer cursor: default position: absolute @@ -1458,6 +1458,8 @@ $sheet-padding: 16px margin: 0 0 0 4px padding: 0 + .oe_searchview_drawer_container + border-bottom: 1px solid $tag-border // }}} // Views Common {{{ diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 832faa4ca62..88cf7531fec 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -340,7 +340,8 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea }, 'click .oe_searchview_unfold_drawer': function (e) { e.stopImmediatePropagation(); - this.$el.toggleClass('oe_searchview_open_drawer'); + if (this.searchview_drawer) + this.searchview_drawer.toggle(); }, 'keydown .oe_searchview_input, .oe_searchview_facet': function (e) { switch(e.which) { @@ -383,14 +384,13 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea this.defaults = defaults || {}; this.has_defaults = !_.isEmpty(this.defaults); - this.inputs = []; - this.controls = []; - this.headless = this.options.hidden && !this.has_defaults; this.input_subviews = []; this.ready = $.Deferred(); + this.drawer_ready = $.Deferred(); + this.fields_view_get = $.Deferred(); }, start: function() { var self = this; @@ -416,20 +416,20 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea }); this.alive($.when(load_view)).then(function (r) { + self.fields_view_get.resolve(r); return self.search_view_loaded(r); }).fail(function () { self.ready.reject.apply(null, arguments); }); } - instance.web.bus.on('click', this, function(ev) { - if ($(ev.target).parents('.oe_searchview').length === 0) { - self.$el.removeClass('oe_searchview_open_drawer'); - } - }); - return $.when(p, this.ready); }, + + set_drawer: function (drawer) { + this.searchview_drawer = drawer; + }, + show: function () { this.$el.show(); }, @@ -462,14 +462,6 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea .$el.focus(); }, - /** - * Sets up thingie where all the mess is put? - */ - select_for_drawer: function () { - return _(this.inputs).filter(function (input) { - return input.in_drawer(); - }); - }, /** * Sets up search view's view-wide auto-completion widget */ @@ -630,87 +622,6 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea }); }, - /** - * Builds a list of widget rows (each row is an array of widgets) - * - * @param {Array} items a list of nodes to convert to widgets - * @param {Object} fields a mapping of field names to (ORM) field attributes - * @param {Object} [group] group to put the new controls in - */ - make_widgets: function (items, fields, group) { - if (!group) { - group = new instance.web.search.Group( - this, 'q', {attrs: {string: _t("Filters")}}); - } - var self = this; - var filters = []; - _.each(items, function (item) { - if (filters.length && item.tag !== 'filter') { - group.push(new instance.web.search.FilterGroup(filters, group)); - filters = []; - } - - switch (item.tag) { - case 'separator': case 'newline': - break; - case 'filter': - filters.push(new instance.web.search.Filter(item, group)); - break; - case 'group': - self.make_widgets(item.children, fields, - new instance.web.search.Group(group, 'w', item)); - break; - case 'field': - var field = this.make_field( - item, fields[item['attrs'].name], group); - group.push(field); - // filters - self.make_widgets(item.children, fields, group); - break; - } - }, this); - - if (filters.length) { - group.push(new instance.web.search.FilterGroup(filters, this)); - } - }, - /** - * Creates a field for the provided field descriptor item (which comes - * from fields_view_get) - * - * @param {Object} item fields_view_get node for the field - * @param {Object} field fields_get result for the field - * @param {Object} [parent] - * @returns instance.web.search.Field - */ - make_field: function (item, field, parent) { - // M2O combined with selection widget is pointless and broken in search views, - // but has been used in the past for unsupported hacks -> ignore it - if (field.type === "many2one" && item.attrs.widget === "selection"){ - item.attrs.widget = undefined; - } - var obj = instance.web.search.fields.get_any( [item.attrs.widget, field.type]); - if(obj) { - return new (obj) (item, field, parent || this); - } else { - console.group('Unknown field type ' + field.type); - console.error('View node', item); - console.info('View field', field); - console.info('In view', this); - console.groupEnd(); - return null; - } - }, - - add_common_inputs: function() { - // add Filters to this.inputs, need view.controls filled - (new instance.web.search.Filters(this)); - // add custom filters to this.inputs - this.custom_filters = new instance.web.search.CustomFilters(this); - // add Advanced to this.inputs - (new instance.web.search.Advanced(this)); - }, - search_view_loaded: function(data) { var self = this; this.fields_view = data; @@ -720,41 +631,28 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea "Got non-search view after asking for a search view: type %s, arch root %s", data.type, data.arch.tag)); } - this.make_widgets( - data['arch'].children, - data.fields); - this.add_common_inputs(); - - // build drawer - var drawer_started = $.when.apply( - null, _(this.select_for_drawer()).invoke( - 'appendTo', this.$('.oe_searchview_drawer'))); - - - // load defaults - var defaults_fetched = $.when.apply(null, _(this.inputs).invoke( - 'facet_for_defaults', this.defaults)) - .then(this.proxy('setup_default_query')); - - return $.when(drawer_started, defaults_fetched) + return this.drawer_ready + .then(this.proxy('setup_default_query')) .then(function () { self.trigger("search_view_loaded", data); self.ready.resolve(); }); }, setup_default_query: function () { + this.ready.resolve(); + return; // Hacky implementation of CustomFilters#facet_for_defaults ensure // CustomFilters will be ready (and CustomFilters#filters will be // correctly filled) by the time this method executes. - var custom_filters = this.custom_filters.filters; + var custom_filters = this.searchview_drawer.custom_filters.filters; if (!this.options.disable_custom_filters && !_(custom_filters).isEmpty()) { // Check for any is_default custom filter var personal_filter = _(custom_filters).find(function (filter) { return filter.user_id && filter.is_default; }); if (personal_filter) { - this.custom_filters.toggle_filter(personal_filter, true); + this.searchview_drawer.custom_filters.toggle_filter(personal_filter, true); return; } @@ -762,7 +660,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea return !filter.user_id && filter.is_default; }); if (global_filter) { - this.custom_filters.toggle_filter(global_filter, true); + this.searchview_drawer.custom_filters.toggle_filter(global_filter, true); return; } } @@ -875,6 +773,146 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea } }); +instance.web.SearchViewDrawer = instance.web.Widget.extend({ + template: "SearchViewDrawer", + + init: function(parent, searchview) { + this._super(parent); + this.searchview = searchview; + this.searchview.set_drawer(this); + this.ready = searchview.drawer_ready; + this.controls = []; + this.inputs = []; + }, + + toggle: function () { + this.$el.toggle(); + }, + + start: function() { + var filters_ready = this.searchview.fields_view_get + .then(this.proxy('prepare_filters')); + return $.when(this._super(), filters_ready) + .then(this.proxy('notify_searchview')); + }, + prepare_filters: function (data) { + this.make_widgets( + data['arch'].children, + data.fields); + + this.add_common_inputs(); + + // build drawer + var drawer_started = $.when.apply( + null, _(this.select_for_drawer()).invoke( + 'appendTo', this.$el)); + + + // load defaults + // var defaults_fetched = $.when.apply(null, _(this.inputs).invoke( + // 'facet_for_defaults', this.defaults)) + // .then(this.proxy('setup_default_query')); + + + }, + notify_searchview: function () { + this.searchview.drawer_ready.resolve(); + + // with args... + // this.searchview.drawer_ready.resolve(); + }, + /** + * Sets up thingie where all the mess is put? + */ + select_for_drawer: function () { + return _(this.inputs).filter(function (input) { + return input.in_drawer(); + }); + }, + + /** + * Builds a list of widget rows (each row is an array of widgets) + * + * @param {Array} items a list of nodes to convert to widgets + * @param {Object} fields a mapping of field names to (ORM) field attributes + * @param {Object} [group] group to put the new controls in + */ + make_widgets: function (items, fields, group) { + if (!group) { + group = new instance.web.search.Group( + this, 'q', {attrs: {string: _t("Filters")}}); + } + var self = this; + var filters = []; + _.each(items, function (item) { + if (filters.length && item.tag !== 'filter') { + group.push(new instance.web.search.FilterGroup(filters, group)); + filters = []; + } + + switch (item.tag) { + case 'separator': case 'newline': + break; + case 'filter': + filters.push(new instance.web.search.Filter(item, group)); + break; + case 'group': + self.make_widgets(item.children, fields, + new instance.web.search.Group(group, 'w', item)); + break; + case 'field': + var field = this.make_field( + item, fields[item['attrs'].name], group); + group.push(field); + // filters + self.make_widgets(item.children, fields, group); + break; + } + }, this); + + if (filters.length) { + group.push(new instance.web.search.FilterGroup(filters, this)); + } + }, + /** + * Creates a field for the provided field descriptor item (which comes + * from fields_view_get) + * + * @param {Object} item fields_view_get node for the field + * @param {Object} field fields_get result for the field + * @param {Object} [parent] + * @returns instance.web.search.Field + */ + make_field: function (item, field, parent) { + // M2O combined with selection widget is pointless and broken in search views, + // but has been used in the past for unsupported hacks -> ignore it + if (field.type === "many2one" && item.attrs.widget === "selection"){ + item.attrs.widget = undefined; + } + var obj = instance.web.search.fields.get_any( [item.attrs.widget, field.type]); + if(obj) { + return new (obj) (item, field, parent || this); + } else { + console.group('Unknown field type ' + field.type); + console.error('View node', item); + console.info('View field', field); + console.info('In view', this); + console.groupEnd(); + return null; + } + }, + + add_common_inputs: function() { + // add Filters to this.inputs, need view.controls filled + (new instance.web.search.Filters(this)); + // add custom filters to this.inputs + this.custom_filters = new instance.web.search.CustomFilters(this); + // add Advanced to this.inputs + (new instance.web.search.Advanced(this)); + }, + +}); + /** * Registry of search fields, called by :js:class:`instance.web.SearchView` to * find and instantiate its field widgets. @@ -932,9 +970,10 @@ instance.web.search.Widget = instance.web.Widget.extend( /** @lends instance.web this._super(parent); var ancestor = parent; do { - this.view = ancestor; - } while (!(ancestor instanceof instance.web.SearchView) + this.drawer = ancestor; + } while (!(ancestor instanceof instance.web.SearchViewDrawer) && (ancestor = (ancestor.getParent && ancestor.getParent()))); + this.view = this.drawer.searchview; } }); @@ -956,7 +995,7 @@ instance.web.search.Group = instance.web.search.Widget.extend({ this.name = attrs.string; this.children = []; - this.view.controls.push(this); + this.drawer.controls.push(this); }, push: function (input) { this.children.push(input); @@ -977,7 +1016,7 @@ instance.web.search.Input = instance.web.search.Widget.extend( /** @lends instan init: function (parent) { this._super(parent); this.load_attrs({}); - this.view.inputs.push(this); + this.drawer.inputs.push(this); }, /** * Fetch auto-completion values for the widget. @@ -1814,22 +1853,13 @@ instance.web.search.Filters = instance.web.search.Input.extend({ _in_drawer: true, start: function () { var self = this; - var running_count = 0; - // get total filters count var is_group = function (i) { return i instanceof instance.web.search.FilterGroup; }; - var visible_filters = _(this.view.controls).chain().reject(function (group) { + var visible_filters = _(this.drawer.controls).chain().reject(function (group) { return _(_(group.children).filter(is_group)).isEmpty() || group.modifiers.invisible; }); - var filters_count = visible_filters - .pluck('children') - .flatten() - .filter(is_group) - .map(function (i) { return i.filters.length; }) - .sum() - .value(); - var col1 = [], col2 = visible_filters.map(function (group) { + var groups = visible_filters.map(function (group) { var filters = _(group.children).filter(is_group); return { name: _.str.sprintf("%s %s", @@ -1840,27 +1870,16 @@ instance.web.search.Filters = instance.web.search.Input.extend({ }; }).value(); - while (col2.length) { - // col1 + group should be smaller than col2 + group - if ((running_count + col2[0].length) <= (filters_count - running_count)) { - running_count += col2[0].length; - col1.push(col2.shift()); - } else { - break; - } - } + var $dl = $('
').appendTo(this.$el); - return $.when( - this.render_column(col1, $('
').appendTo(this.$el)), - this.render_column(col2, $('
').appendTo(this.$el))); + var rendered_lines = _.map(groups, function (group) { + $('
').html(group.name).appendTo($dl); + var $dd = $('
').appendTo($dl); + return $.when.apply(null, _(group.filters).invoke('appendTo', $dd)); + }); + + return $.when.apply(this, rendered_lines); }, - render_column: function (column, $el) { - return $.when.apply(null, _(column).map(function (group) { - $('

').html(group.name).appendTo($el); - return $.when.apply(null, - _(group.filters).invoke('appendTo', $el)); - })); - } }); instance.web.search.Advanced = instance.web.search.Input.extend({ diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 753d52d497a..f954ebd9ad5 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -553,6 +553,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ this.model = dataset ? dataset.model : undefined; this.dataset = dataset; this.searchview = null; + this.searchview_drawer = null; this.active_view = null; this.views_src = _.map(views, function(x) { if (x instanceof Array) { @@ -800,14 +801,20 @@ instance.web.ViewManager = instance.web.Widget.extend({ if (this.searchview) { this.searchview.destroy(); } + if (this.searchview_drawer) { + this.searchview_drawer.destroy(); + } + var options = { hidden: this.flags.search_view === false, disable_custom_filters: this.flags.search_disable_custom_filters, }; this.searchview = new instance.web.SearchView(this, this.dataset, view_id, search_defaults, options); + this.searchview_drawer = new instance.web.SearchViewDrawer(this, this.searchview); this.searchview.on('search_data', self, this.do_searchview_search); - return this.searchview.appendTo(this.$el.find(".oe_view_manager_view_search")); + return $.when(this.searchview.appendTo(this.$el.find(".oe_view_manager_view_search")), + this.searchview_drawer.appendTo(this.$(".oe_searchview_drawer_container"))); }, do_searchview_search: function(domains, contexts, groupbys) { var self = this, diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index f801e6c7c71..22e344f2b3d 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -520,6 +520,8 @@ +
+
@@ -1555,11 +1557,13 @@
-
+ +
Date: Mon, 19 May 2014 15:40:45 +0200 Subject: [PATCH 02/48] [FIX] add support for default filters in search view support for default filters was broken in the previous commit, now it works again. --- addons/web/static/src/css/base.css | 1 + addons/web/static/src/css/base.sass | 3 ++- addons/web/static/src/js/search.js | 28 ++++++++++++++-------------- addons/web/static/src/xml/base.xml | 2 +- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 03066c171b4..ade49c3b1fe 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1778,6 +1778,7 @@ } .openerp .oe_searchview_drawer_container { border-bottom: 1px solid #afafb6; + overflow: auto; } .openerp .oe_view_nocontent { padding: 15px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index e1296924629..d85b55d854c 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1280,7 +1280,7 @@ $sheet-padding: 16px &.oe_searchview_open_drawer .oe_searchview_drawer display: block - + .oe_searchview_drawer cursor: default position: absolute @@ -1460,6 +1460,7 @@ $sheet-padding: 16px .oe_searchview_drawer_container border-bottom: 1px solid $tag-border + overflow: auto // }}} // Views Common {{{ diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 88cf7531fec..0bd4c89f002 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -640,8 +640,6 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea }); }, setup_default_query: function () { - this.ready.resolve(); - return; // Hacky implementation of CustomFilters#facet_for_defaults ensure // CustomFilters will be ready (and CustomFilters#filters will be // correctly filled) by the time this method executes. @@ -803,23 +801,25 @@ instance.web.SearchViewDrawer = instance.web.Widget.extend({ this.add_common_inputs(); // build drawer - var drawer_started = $.when.apply( - null, _(this.select_for_drawer()).invoke( - 'appendTo', this.$el)); + var in_drawer = this.select_for_drawer(); - - // load defaults - // var defaults_fetched = $.when.apply(null, _(this.inputs).invoke( - // 'facet_for_defaults', this.defaults)) - // .then(this.proxy('setup_default_query')); + var self = this; + var second_col = $('
'); + var insert_first_col = in_drawer[0].appendTo(this.$el).then(function () { + second_col.appendTo(self.$el); + }).then(function () { + return $.when.apply(null, + _(_.rest(in_drawer)).invoke('appendTo', second_col)); + }); + + return $.when.apply(null, _(this.inputs).invoke( + 'facet_for_defaults', this.searchview.defaults)); }, notify_searchview: function () { - this.searchview.drawer_ready.resolve(); - - // with args... - // this.searchview.drawer_ready.resolve(); + var defaults = arguments[1]; + this.searchview.drawer_ready.resolve.apply(null, defaults); }, /** * Sets up thingie where all the mess is put? diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 22e344f2b3d..542a7408f54 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1717,7 +1717,7 @@
-
+
From c70df56174be6611bda2a18b14b5145fa365dfe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 19 May 2014 17:03:05 +0200 Subject: [PATCH 03/48] [IMP] lots of layout work for inline search view (addon web) mainly to correctly style the custom filters list. --- addons/web/static/src/css/base.css | 200 ++++++++++++++++++++++++++++ addons/web/static/src/css/base.sass | 164 +++++++++++++++++++++++ addons/web/static/src/js/search.js | 21 +-- addons/web/static/src/xml/base.xml | 33 ++--- 4 files changed, 392 insertions(+), 26 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index ade49c3b1fe..085e0d5e08e 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1780,6 +1780,206 @@ border-bottom: 1px solid #afafb6; overflow: auto; } +.openerp .oe_searchview_drawer { + cursor: default; + display: none; + overflow: hidden; + border-bottom: 1px solid #afafb6; + border-right: 1px solid #afafb6; + text-align: left; + padding: 8px 0; +} +.openerp .oe_searchview_drawer .badge { + font-size: 12px; + line-height: 12px; +} +.openerp .oe_searchview_drawer > div:first-child { + border: none; + padding-left: 0; +} +.openerp .oe_searchview_drawer > div:first-child li:hover:not(.badge) { + background-color: #f0f0fa; +} +.openerp .oe_searchview_drawer .col-md-5 { + padding-left: 0; +} +.openerp .oe_searchview_drawer dl { + margin-bottom: 10px; +} +.openerp .oe_searchview_drawer dt { + color: #7c7bad; + font-size: 13px; + line-height: 24px; +} +.openerp .oe_searchview_drawer dd { + line-height: 24px; + font-size: 13px; + padding-top: 3px; +} +.openerp .oe_searchview_drawer h4, .openerp .oe_searchview_drawer h4 * { + margin: 0 0 0 2px; + padding-left: 20px; + cursor: pointer; + font-weight: normal; + display: inline-block; +} +.openerp .oe_searchview_drawer h4:hover, .openerp .oe_searchview_drawer h4 *:hover { + background-color: #f0f0fa; +} +.openerp .oe_searchview_drawer h4:before { + content: "▸ "; + color: #a3a3a3; +} +.openerp .oe_searchview_drawer button { + margin: 4px 0; +} +.openerp .oe_searchview_drawer .button { + border: none; + background: transparent; + padding: 0 2px; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +.openerp .oe_searchview_drawer .oe_searchview_section ul { + margin: 0 8px; + padding: 0; + list-style: none; + display: inline; +} +.openerp .oe_searchview_drawer .oe_searchview_section li { + display: inline-block; + cursor: pointer; + position: relative; + margin-right: 8px; +} +.openerp .oe_searchview_drawer form { + margin-left: 12px; +} +.openerp .oe_searchview_drawer form p { + margin: 4px 0; + line-height: 18px; +} +.openerp .oe_searchview_drawer form button { + margin: 0 0 8px -3px; +} +.openerp .oe_searchview_drawer .oe_searchview_custom dt { + width: 140px; +} +.openerp .oe_searchview_drawer .oe_searchview_custom dd { + margin-left: 145px; +} +.openerp .oe_searchview_drawer .oe_searchview_custom form { + display: none; +} +.openerp .oe_searchview_drawer .oe_searchview_custom li { + cursor: pointer; + position: relative; + line-height: 14px; + margin-right: 0; +} +.openerp .oe_searchview_drawer .oe_searchview_custom li button { + position: absolute; + top: 0; + right: 5px; +} +.openerp .oe_searchview_drawer .oe_searchview_custom li a { + margin-left: 10px; + position: inherit; + visibility: hidden; + display: inline-block; +} +.openerp .oe_searchview_drawer .oe_searchview_custom li span:hover:not(.badge) { + background-color: #f0f0fa; +} +.openerp .oe_searchview_drawer .oe_searchview_custom li:hover a { + visibility: visible; +} +.openerp .oe_searchview_drawer .oe_searchview_custom label { + font-weight: normal; +} +.openerp .oe_searchview_drawer .oe_searchview_dashboard form { + display: none; + margin-top: 2px; +} +.openerp .oe_searchview_drawer .oe_searchview_advanced form { + display: none; + margin-top: 8px; +} +.openerp .oe_searchview_drawer .oe_searchview_advanced button.oe_add_condition:before { + content: "Z"; + font-family: "entypoRegular" !important; + font-size: 24px; + font-weight: 300 !important; + margin-right: 4px; +} +.openerp .oe_searchview_drawer .oe_searchview_advanced ul { + list-style: none; + padding: 0; +} +.openerp .oe_searchview_drawer .oe_searchview_advanced li { + position: relative; + list-style: none; + margin: 0; + white-space: nowrap; +} +.openerp .oe_searchview_drawer .oe_searchview_advanced li:first-child .searchview_extended_prop_or { + visibility: hidden; + margin-left: -14px; +} +.openerp .oe_searchview_drawer .oe_searchview_advanced .searchview_extended_prop_or { + opacity: 0.5; + margin-left: -14px; +} +.openerp .oe_searchview_drawer .oe_opened h4:before { + content: "▾ "; + position: relative; + top: -1px; +} +.openerp .oe_searchview_drawer .oe_opened form { + display: block; +} +.openerp .oe_searchview_drawer .oe_searchview_custom_delete, .openerp .oe_searchview_drawer .searchview_extended_delete_prop { + display: inline-block; + width: 12px; + height: 12px; + line-height: 12px; + padding: 1px; + color: #8786b7; + line-height: 8px; + text-align: center; + font-weight: bold; + text-shadow: 0 1px 1px white; +} +.openerp .oe_searchview_drawer .oe_searchview_custom_delete:hover, .openerp .oe_searchview_drawer .searchview_extended_delete_prop:hover { + text-decoration: none; + color: white; + background: #8786b7; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; +} +.openerp .oe_searchview_drawer .oe_searchview_custom_delete { + display: none; + position: absolute; + bottom: 1px; + right: 4px; +} +.openerp .oe_searchview_drawer .oe_searchview_custom_private:hover .oe_searchview_custom_delete, .openerp .oe_searchview_drawer .oe_searchview_custom_public:hover .oe_searchview_custom_delete { + display: inline-block; +} +.openerp .oe_searchview_drawer .oe_searchview_custom_public:after { + content: ","; + font-family: "entypoRegular" !important; + font-size: 22px; + font-weight: 300 !important; + margin: 0 0 0 4px; + padding: 0; +} .openerp .oe_view_nocontent { padding: 15px; margin-top: 0; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index d85b55d854c..9b02b20b82a 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1461,7 +1461,171 @@ $sheet-padding: 16px .oe_searchview_drawer_container border-bottom: 1px solid $tag-border overflow: auto + .oe_searchview_drawer + cursor: default + display: none + overflow: hidden + border-bottom: 1px solid $tag-border + border-right: 1px solid $tag-border + text-align: left + padding: 8px 0 + .badge + font-size: 12px + line-height: 12px + > div:first-child + border: none + padding-left: 0 + li:hover:not(.badge) + background-color: $hover-background + .col-md-5 + padding-left: 0 + dl + margin-bottom: 10px + dt + color: $section-title-color + font-size: 13px + line-height: 24px + dd + line-height: 24px + font-size: 13px + padding-top: 3px + h4, h4 * + margin: 0 0 0 2px + padding-left: 20px + cursor: pointer + font-weight: normal + display: inline-block + &:hover + background-color: $hover-background + h4:before + content: "▸ " + color: #a3a3a3 + button + margin: 4px 0 + .button + border: none + background: transparent + padding: 0 2px + @include box-shadow(none) + @include radius(0) + .oe_searchview_section + ul + margin: 0 8px + padding: 0 + list-style: none + display: inline + li + display: inline-block + cursor: pointer + position: relative + margin-right: 8px + form + margin-left: 12px + p + margin: 4px 0 + line-height: 18px + button + margin: 0 0 8px -3px // Managed margin-left according bootstrap3 + .oe_searchview_custom + dt + width: 140px + dd + margin-left: 145px + form + display: none + li + cursor: pointer + position: relative + line-height: 14px + margin-right: 0 + button + position: absolute + top: 0 + right: 5px + a + margin-left: 10px + position: inherit + visibility: hidden + display: inline-block + span:hover:not(.badge) + background-color: $hover-background + li:hover a + visibility: visible + //Customize for searchview label + label + font-weight: normal + //End of Customize + .oe_searchview_dashboard + form + display: none + margin-top: 2px + .oe_searchview_advanced + form + display: none + margin-top: 8px + button.oe_add_condition:before + content: "Z" + font-family: "entypoRegular" !important + font-size: 24px + font-weight: 300 !important + margin-right: 4px + ul + list-style: none + padding: 0 + li + position: relative + list-style: none + margin: 0 + white-space: nowrap + &:first-child .searchview_extended_prop_or + visibility: hidden + margin-left: -14px + .searchview_extended_prop_or + opacity: 0.5 + margin-left: -14px //Customize 'or' in searchview + .oe_opened + h4:before + content: "▾ " + position: relative + top: -1px + form + display: block + + // delete buttons + .oe_searchview_custom_delete, .searchview_extended_delete_prop + display: inline-block + width: 12px + height: 12px + line-height: 12px + padding: 1px + color: #8786b7 + line-height: 8px + text-align: center + font-weight: bold + text-shadow: 0 1px 1px white + &:hover + text-decoration: none + color: white + background: #8786b7 + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4) + @include radius(2px) + .oe_searchview_custom_delete + display: none + position: absolute + bottom: 1px + right: 4px + .oe_searchview_custom_private, .oe_searchview_custom_public + &:hover + .oe_searchview_custom_delete + display: inline-block + .oe_searchview_custom_public:after + content: "," + font-family: "entypoRegular" !important + font-size: 22px + font-weight: 300 !important + margin: 0 0 0 4px + padding: 0 // }}} // Views Common {{{ .oe_view_nocontent diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 0bd4c89f002..fa7cc0ce8c0 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1127,7 +1127,7 @@ instance.web.search.FilterGroup = instance.web.search.Input.extend(/** @lends in */ search_change: function () { var self = this; - var $filters = this.$('> li').removeClass('oe_selected'); + var $filters = this.$('> li').removeClass('badge'); var facet = this.view.query.find(_.bind(this.match_facet, this)); if (!facet) { return; } facet.values.each(function (v) { @@ -1135,7 +1135,7 @@ instance.web.search.FilterGroup = instance.web.search.Input.extend(/** @lends in if (i === -1) { return; } $filters.filter(function () { return Number($(this).data('index')) === i; - }).addClass('oe_selected'); + }).addClass('badge'); }); }, /** @@ -1747,7 +1747,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ }; }, clear_selection: function () { - this.$('li.oe_selected').removeClass('oe_selected'); + this.$('span.badge').removeClass('badge'); }, append_filter: function (filter) { var self = this; @@ -1760,12 +1760,13 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ } else { var id = filter.id; this.filters[key] = filter; - $filter = this.$filters[key] = $('
  • ') + $filter = $('
  • ') .appendTo(this.$('.oe_searchview_custom_list')) - .addClass(filter.user_id ? 'oe_searchview_custom_private' - : 'oe_searchview_custom_public') .toggleClass('oe_searchview_custom_default', filter.is_default) - .text(filter.name); + .append(this.$filters[key] = $('').text(filter.name)); + + this.$filters[key].addClass(filter.user_id ? 'oe_searchview_custom_private' + : 'oe_searchview_custom_public') $('x') .click(function (e) { @@ -1782,7 +1783,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ .appendTo($filter); } - $filter.unbind('click').click(function () { + this.$filters[key].unbind('click').click(function () { self.toggle_filter(filter); }); }, @@ -1792,12 +1793,12 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ }); if (current) { this.view.query.remove(current); - this.$filters[this.key_for(filter)].removeClass('oe_selected'); + this.$filters[this.key_for(filter)].removeClass('badge'); return; } this.view.query.reset([this.facet_for(filter)], { preventSearch: preventSearch || false}); - this.$filters[this.key_for(filter)].addClass('oe_selected'); + this.$filters[this.key_for(filter)].addClass('badge'); }, set_filters: function (filters) { _(filters).map(_.bind(this.append_filter, this)); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 542a7408f54..93f6ee924f7 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1720,23 +1720,24 @@
    +
    -
    -

    M Custom Filters

    -
      -
      -

      Save current filter

      -
      -

      -

      - - - - -

      - -
      -
      +
      +
      M Custom Filters
      +
        +
        +
        +

        Save current filter

        +
        +

        +

        + + + + +

        + +
      From 72f532a4630fd123d0a3fdff1aa621079ede5ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Tue, 20 May 2014 10:54:58 +0200 Subject: [PATCH 04/48] [IMP] hide drawer when switching views (addon web) the drawer wasn't closed when switching views, which might be a problem when the user switches to a form view. Also, renames the variable 'searchview_drawer' to 'drawer'. --- addons/web/static/src/js/search.js | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index fa7cc0ce8c0..d9f2a3c5c62 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -340,8 +340,8 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea }, 'click .oe_searchview_unfold_drawer': function (e) { e.stopImmediatePropagation(); - if (this.searchview_drawer) - this.searchview_drawer.toggle(); + if (this.drawer) + this.drawer.toggle(); }, 'keydown .oe_searchview_input, .oe_searchview_facet': function (e) { switch(e.which) { @@ -423,11 +423,19 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea }); } + var view_manager = this.getParent(); + while (!(view_manager instanceof instance.web.ViewManager)) { + view_manager = view_manager.getParent(); + } + view_manager.on('switch_mode', this, function (e) { + self.drawer.hide(); + }) + return $.when(p, this.ready); }, set_drawer: function (drawer) { - this.searchview_drawer = drawer; + this.drawer = drawer; }, show: function () { @@ -522,7 +530,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea * @param {Function} resp response callback */ complete_global_search: function (req, resp) { - $.when.apply(null, _(this.inputs).chain() + $.when.apply(null, _(this.drawer.inputs).chain() .filter(function (input) { return input.visible(); }) .invoke('complete', req.term) .value()).then(function () { @@ -643,14 +651,14 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea // Hacky implementation of CustomFilters#facet_for_defaults ensure // CustomFilters will be ready (and CustomFilters#filters will be // correctly filled) by the time this method executes. - var custom_filters = this.searchview_drawer.custom_filters.filters; + var custom_filters = this.drawer.custom_filters.filters; if (!this.options.disable_custom_filters && !_(custom_filters).isEmpty()) { // Check for any is_default custom filter var personal_filter = _(custom_filters).find(function (filter) { return filter.user_id && filter.is_default; }); if (personal_filter) { - this.searchview_drawer.custom_filters.toggle_filter(personal_filter, true); + this.drawer.custom_filters.toggle_filter(personal_filter, true); return; } @@ -658,7 +666,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea return !filter.user_id && filter.is_default; }); if (global_filter) { - this.searchview_drawer.custom_filters.toggle_filter(global_filter, true); + this.drawer.custom_filters.toggle_filter(global_filter, true); return; } } @@ -787,6 +795,10 @@ instance.web.SearchViewDrawer = instance.web.Widget.extend({ this.$el.toggle(); }, + hide: function () { + this.$el.hide(); + }, + start: function() { var filters_ready = this.searchview.fields_view_get .then(this.proxy('prepare_filters')); From 1c32d931159cb420d3f6ff51d6d21beb674d9c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Tue, 20 May 2014 11:41:28 +0200 Subject: [PATCH 05/48] [FIX] correctly display the searchview/drawer (addon web) the searchview has been splitted in two widgets: SearchView and SearchViewDrawer. They are dependent of each other, so a drawer has to be created for each searchview. This was not the case in some form views (inline, created by a wizard). --- addons/web/static/src/css/base.css | 1 + addons/web/static/src/css/base.sass | 1 + addons/web/static/src/js/search.js | 2 +- addons/web/static/src/js/view_form.js | 5 +++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 085e0d5e08e..dda3a83c9f8 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1781,6 +1781,7 @@ overflow: auto; } .openerp .oe_searchview_drawer { + width: 100%; cursor: default; display: none; overflow: hidden; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 9b02b20b82a..1069de614f5 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1462,6 +1462,7 @@ $sheet-padding: 16px border-bottom: 1px solid $tag-border overflow: auto .oe_searchview_drawer + width: 100% cursor: default display: none overflow: hidden diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index d9f2a3c5c62..08246ca649a 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -831,7 +831,7 @@ instance.web.SearchViewDrawer = instance.web.Widget.extend({ }, notify_searchview: function () { var defaults = arguments[1]; - this.searchview.drawer_ready.resolve.apply(null, defaults); + this.ready.resolve.apply(null, defaults); }, /** * Sets up thingie where all the mess is put? diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 4c4ba6f004c..a568f217145 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5295,8 +5295,12 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend if (this.searchview) { this.searchview.destroy(); } + if (this.searchview_drawer) { + this.searchview_drawer.destroy(); + } this.searchview = new instance.web.SearchView(this, this.dataset, false, search_defaults); + this.searchview_drawer = new instance.web.SearchViewDrawer(this, this.searchview); this.searchview.on('search_data', self, function(domains, contexts, groupbys) { if (self.initial_ids) { self.do_search(domains.concat([[["id", "in", self.initial_ids]], self.domain]), @@ -5343,6 +5347,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend }); }); this.searchview.appendTo($(".oe_popup_search", self.$el)); + this.searchview_drawer.appendTo($(".oe_popup_search", self.$el)); }, do_search: function(domains, contexts, groupbys) { var self = this; From 2c8dec5daacb68048e08d9c2037412c1acc0dafa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Tue, 20 May 2014 11:56:06 +0200 Subject: [PATCH 06/48] [FIX] remove an extra border-bottom css rule (addon web) the border-bottom was set on drawer_container and on drawer, resulting in a double border. --- addons/web/static/src/css/base.css | 1 - addons/web/static/src/css/base.sass | 1 - 2 files changed, 2 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index dda3a83c9f8..000a0a0135c 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1777,7 +1777,6 @@ padding: 0; } .openerp .oe_searchview_drawer_container { - border-bottom: 1px solid #afafb6; overflow: auto; } .openerp .oe_searchview_drawer { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 1069de614f5..9380af85057 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1459,7 +1459,6 @@ $sheet-padding: 16px padding: 0 .oe_searchview_drawer_container - border-bottom: 1px solid $tag-border overflow: auto .oe_searchview_drawer width: 100% From 7c6c720425f2915ded93534171aff265dab049ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Tue, 20 May 2014 15:27:44 +0200 Subject: [PATCH 07/48] [IMP] better architecture for searchview/drawer Before, the searchview and the searchview drawer had to be instantiated by the user and appended separately to their correct place. Now, the searchview is responsible for creating/destroying the drawer, and the user is responsible for correctly using the insert method with the node where the searchview/drawer are to be inserted. --- addons/mail/static/src/js/mail.js | 5 ++-- addons/web/static/src/js/search.js | 36 ++++++++++++++++++++++++--- addons/web/static/src/js/view_form.js | 3 +-- addons/web/static/src/js/views.js | 9 ++----- 4 files changed, 37 insertions(+), 16 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 9cf33203a45..cb01efae515 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -1888,10 +1888,9 @@ openerp.mail = function (session) { var self = this; var ds_msg = new session.web.DataSetSearch(this, 'mail.message'); this.searchview = new session.web.SearchView(this, ds_msg, false, defaults || {}, false); - this.searchview_drawer = new session.web.SearchViewDrawer(this, this.searchview); - $.when(this.searchview.appendTo(this.$('.oe_view_manager_view_search')), - this.searchview_drawer.appendTo(this.$('.oe_searchview_drawer_container'))) + this.searchview.insert(this.$('.oe_view_manager_view_search'), + this.$('.oe_searchview_drawer_container')) .then(function () { self.searchview.on('search_data', self, self.do_searchview_search); }); if (this.searchview.has_defaults) { this.searchview.ready.then(this.searchview.do_search); diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 08246ca649a..2c7ef9948b6 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -391,6 +391,8 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea this.ready = $.Deferred(); this.drawer_ready = $.Deferred(); this.fields_view_get = $.Deferred(); + this.drawer = new instance.web.SearchViewDrawer(parent, this); + }, start: function() { var self = this; @@ -424,13 +426,16 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea } var view_manager = this.getParent(); - while (!(view_manager instanceof instance.web.ViewManager)) { + while (!(view_manager instanceof instance.web.ViewManager) && + (view_manager !== undefined)) { view_manager = view_manager.getParent(); } - view_manager.on('switch_mode', this, function (e) { - self.drawer.hide(); - }) + if (view_manager) { + view_manager.on('switch_mode', this, function (e) { + self.drawer.hide(); + }); + } return $.when(p, this.ready); }, @@ -776,6 +781,29 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea on_invalid: function (errors) { this.do_notify(_t("Invalid Search"), _t("triggered from search view")); this.trigger('invalid_search', errors); + }, + + // The method appendTo is overwrited to make sure that the search view is not + // appendTo'ed. Instead, the correct way to insert the searchview in the DOM + // is by using insert + appendTo: function () { + throw new Error("SearchView should be inserted, not appended"); + }, + + // This is the correct way to insert the searchview in the dom. First argument + // is for the searchview, and second is the place where the drawer should be + // appended. + insert: function ($searchview_parent, $searchview_drawer_node) { + var parent = this.getParent(), + $searchview_drawer_node = $searchview_drawer_node || $searchview_parent, + insert_searchview = parent.appendTo.call(this, $searchview_parent), + insert_drawer = parent.appendTo.call(this.drawer, $searchview_drawer_node); + return $.when(insert_searchview, insert_drawer); + }, + + destroy: function () { + this.drawer.destroy(); + this.getParent().destroy.call(this); } }); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index a568f217145..797ecd0e807 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5346,8 +5346,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend }); }); }); - this.searchview.appendTo($(".oe_popup_search", self.$el)); - this.searchview_drawer.appendTo($(".oe_popup_search", self.$el)); + this.searchview.insert(this.$(".oe_popup_search")); }, do_search: function(domains, contexts, groupbys) { var self = this; diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index f954ebd9ad5..8f01c4775c2 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -553,7 +553,6 @@ instance.web.ViewManager = instance.web.Widget.extend({ this.model = dataset ? dataset.model : undefined; this.dataset = dataset; this.searchview = null; - this.searchview_drawer = null; this.active_view = null; this.views_src = _.map(views, function(x) { if (x instanceof Array) { @@ -801,20 +800,16 @@ instance.web.ViewManager = instance.web.Widget.extend({ if (this.searchview) { this.searchview.destroy(); } - if (this.searchview_drawer) { - this.searchview_drawer.destroy(); - } var options = { hidden: this.flags.search_view === false, disable_custom_filters: this.flags.search_disable_custom_filters, }; this.searchview = new instance.web.SearchView(this, this.dataset, view_id, search_defaults, options); - this.searchview_drawer = new instance.web.SearchViewDrawer(this, this.searchview); this.searchview.on('search_data', self, this.do_searchview_search); - return $.when(this.searchview.appendTo(this.$el.find(".oe_view_manager_view_search")), - this.searchview_drawer.appendTo(this.$(".oe_searchview_drawer_container"))); + return this.searchview.insert(this.$(".oe_view_manager_view_search"), + this.$(".oe_searchview_drawer_container")); }, do_searchview_search: function(domains, contexts, groupbys) { var self = this, From cc64d1d3180a56cfef6de073f1889129b82286a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Tue, 20 May 2014 16:18:03 +0200 Subject: [PATCH 08/48] [FIX] fix the graphview field selection searchview has been split in two parts, and the inputs are now located in the drawer --- addons/web_graph/static/src/js/graph_widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index d0038452dfb..ae9be9e0844 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -86,7 +86,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ get_search_fields: function () { var self = this; - var groupbygroups = _(this.search_view.inputs).select(function (g) { + var groupbygroups = _(this.search_view.drawer.inputs).select(function (g) { return g instanceof openerp.web.search.GroupbyGroup; }); From aec3ba08ae6b8ec50c8f1cb57ae510f567556d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 21 May 2014 13:18:30 +0200 Subject: [PATCH 09/48] [IMP] improvements to inline searchview (web) this commit splits the widget CustomFilters in two widgets: CustomReports and SaveFilter. CustomReports is the widget displaying the list of reports, and SaveFilter obviously is the Save Current Filter widget. The goal was to put the custom reports in the first column and the Save Current Filter form in the second. --- addons/web/static/src/css/base.css | 228 +--------------------------- addons/web/static/src/css/base.sass | 186 +---------------------- addons/web/static/src/js/search.js | 61 +++++--- addons/web/static/src/xml/base.xml | 12 +- 4 files changed, 48 insertions(+), 439 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 000a0a0135c..f46a0de5836 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1556,226 +1556,6 @@ -webkit-border-radius: 2px; border-radius: 2px; } -.openerp .oe_searchview.oe_searchview_open_drawer .oe_searchview_drawer { - display: block; -} -.openerp .oe_searchview .oe_searchview_drawer { - cursor: default; - position: absolute; - z-index: 2; - margin-top: 4px; - top: 100%; - right: -1px; - background-color: white; - min-width: 100%; - display: none; - border: 1px solid #afafb6; - text-align: left; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); - -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); -} -.openerp .oe_searchview .oe_searchview_drawer > div { - border-top: 1px solid #cccccc; - margin: 0; - padding: 8px; -} -.openerp .oe_searchview .oe_searchview_drawer > div:first-child { - border-top: none; - margin: 0; -} -.openerp .oe_searchview .oe_searchview_drawer h3 { - margin: 8px 4px 4px 0px; - color: #7c7bad; - font-size: 13px; -} -.openerp .oe_searchview .oe_searchview_drawer h4, .openerp .oe_searchview .oe_searchview_drawer h4 * { - margin: 0 0 0 2px; - cursor: pointer; - font-weight: normal; - display: inline-block; -} -.openerp .oe_searchview .oe_searchview_drawer h4:hover, .openerp .oe_searchview .oe_searchview_drawer h4 *:hover { - background-color: #f0f0fa; -} -.openerp .oe_searchview .oe_searchview_drawer h4:before { - content: "▸ "; - color: #a3a3a3; -} -.openerp .oe_searchview .oe_searchview_drawer button { - margin: 4px 0; -} -.openerp .oe_searchview .oe_searchview_drawer .button { - border: none; - background: transparent; - padding: 0 2px; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; - -moz-border-radius: 0; - -webkit-border-radius: 0; - border-radius: 0; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_section { - display: table; - width: 100%; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_section > div { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - display: table-cell; - width: 50%; - padding-left: 2px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_section ul { - margin: 0 8px 8px; - padding: 0; - list-style: none; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_section li { - list-style: none; - padding: 2px 4px 2px 20px; - line-height: 14px; - color: inherit; - cursor: pointer; - position: relative; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_section li.oe_selected:before { - content: "W"; - font-family: "entypoRegular" !important; - font-size: 24px; - font-weight: 300 !important; - color: #a3a3a3; - position: absolute; - left: 4px; - top: -2px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_section li:hover { - background-color: #f0f0fa; -} -.openerp .oe_searchview .oe_searchview_drawer form { - margin-left: 12px; -} -.openerp .oe_searchview .oe_searchview_drawer form p { - margin: 4px 0; - line-height: 18px; -} -.openerp .oe_searchview .oe_searchview_drawer form button { - margin: 0 0 8px -3px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom { - padding: 0 8px 8px 8px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom div { - padding: 0; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom div h4 { - margin: 0; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom form { - display: none; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom li { - cursor: pointer; - position: relative; - line-height: 14px; - padding: 2px 4px 2px 20px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom li:hover { - background-color: #f0f0fa; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom li button { - position: absolute; - top: 0; - right: 5px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom label { - font-weight: normal; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_dashboard form { - display: none; - margin-top: 2px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_advanced form { - display: none; - margin-top: 8px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_advanced button.oe_add_condition:before { - content: "Z"; - font-family: "entypoRegular" !important; - font-size: 24px; - font-weight: 300 !important; - margin-right: 4px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_advanced ul { - list-style: none; - padding: 0; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_advanced li { - position: relative; - list-style: none; - margin: 0; - white-space: nowrap; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_advanced li:first-child .searchview_extended_prop_or { - visibility: hidden; - margin-left: -14px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_advanced .searchview_extended_prop_or { - opacity: 0.5; - margin-left: -14px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_opened h4:before { - content: "▾ "; - position: relative; - top: -1px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_opened form { - display: block; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom_delete, .openerp .oe_searchview .oe_searchview_drawer .searchview_extended_delete_prop { - display: inline-block; - width: 12px; - height: 12px; - line-height: 12px; - padding: 1px; - color: #8786b7; - line-height: 8px; - text-align: center; - font-weight: bold; - text-shadow: 0 1px 1px white; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom_delete:hover, .openerp .oe_searchview .oe_searchview_drawer .searchview_extended_delete_prop:hover { - text-decoration: none; - color: white; - background: #8786b7; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom_delete { - display: none; - position: absolute; - bottom: 1px; - right: 4px; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom_private:hover .oe_searchview_custom_delete, .openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom_public:hover .oe_searchview_custom_delete { - display: inline-block; -} -.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom_public:after { - content: ","; - font-family: "entypoRegular" !important; - font-size: 22px; - font-weight: 300 !important; - margin: 0 0 0 4px; - padding: 0; -} .openerp .oe_searchview_drawer_container { overflow: auto; } @@ -1804,7 +1584,7 @@ padding-left: 0; } .openerp .oe_searchview_drawer dl { - margin-bottom: 10px; + margin-bottom: 0; } .openerp .oe_searchview_drawer dt { color: #7c7bad; @@ -1866,12 +1646,6 @@ .openerp .oe_searchview_drawer form button { margin: 0 0 8px -3px; } -.openerp .oe_searchview_drawer .oe_searchview_custom dt { - width: 140px; -} -.openerp .oe_searchview_drawer .oe_searchview_custom dd { - margin-left: 145px; -} .openerp .oe_searchview_drawer .oe_searchview_custom form { display: none; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 9380af85057..18da5a7098c 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1277,186 +1277,6 @@ $sheet-padding: 16px background: #8786b7 text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4) @include radius(2px) - &.oe_searchview_open_drawer - .oe_searchview_drawer - display: block - - .oe_searchview_drawer - cursor: default - position: absolute - z-index: 2 - // detach drawer from field slightly - margin-top: 4px - top: 100% - right: -1px - background-color: white - min-width: 100% - display: none - border: 1px solid $tag-border - text-align: left - @include radius(4px) - @include box-shadow(0 1px 4px rgba(0,0,0,0.3)) - > div - border-top: 1px solid #ccc - margin: 0 - padding: 8px - > div:first-child - border-top: none - margin: 0 - h3 - margin: 8px 4px 4px 0px - color: $section-title-color - font-size: 13px - h4, h4 * - margin: 0 0 0 2px - cursor: pointer - font-weight: normal - display: inline-block - &:hover - background-color: $hover-background - h4:before - content: "▸ " - color: #a3a3a3 - button - margin: 4px 0 - .button - border: none - background: transparent - padding: 0 2px - @include box-shadow(none) - @include radius(0) - .oe_searchview_section - display: table - width: 100% - > div - @include box-sizing(border) - display: table-cell - width: 50% - padding-left: 2px // Managed padding-left according bootstrap3 - ul - margin: 0 8px 8px - padding: 0 - list-style: none - li - list-style: none - padding: 2px 4px 2px 20px - line-height: 14px - color: inherit - cursor: pointer - position: relative - &.oe_selected:before - content: "W" - font-family: "entypoRegular" !important - font-size: 24px - font-weight: 300 !important - color: #a3a3a3 - position: absolute - left: 4px - top: -2px - // after oe_selected so background color is not overridden - &:hover - background-color: $hover-background - form - margin-left: 12px - p - margin: 4px 0 - line-height: 18px - button - margin: 0 0 8px -3px // Managed margin-left according bootstrap3 - .oe_searchview_custom - padding: 0 8px 8px 8px - div - padding: 0 - h4 - margin: 0 - form - display: none - li - cursor: pointer - position: relative - line-height: 14px - padding: 2px 4px 2px 20px - &:hover - background-color: $hover-background - button - position: absolute - top: 0 - right: 5px - //Customize for searchview label - label - font-weight: normal - //End of Customize - .oe_searchview_dashboard - form - display: none - margin-top: 2px - - .oe_searchview_advanced - form - display: none - margin-top: 8px - button.oe_add_condition:before - content: "Z" - font-family: "entypoRegular" !important - font-size: 24px - font-weight: 300 !important - margin-right: 4px - ul - list-style: none - padding: 0 - li - position: relative - list-style: none - margin: 0 - white-space: nowrap - &:first-child .searchview_extended_prop_or - visibility: hidden - margin-left: -14px - .searchview_extended_prop_or - opacity: 0.5 - margin-left: -14px //Customize 'or' in searchview - .oe_opened - h4:before - content: "▾ " - position: relative - top: -1px - form - display: block - - // delete buttons - .oe_searchview_custom_delete, .searchview_extended_delete_prop - display: inline-block - width: 12px - height: 12px - line-height: 12px - padding: 1px - color: #8786b7 - line-height: 8px - text-align: center - font-weight: bold - text-shadow: 0 1px 1px white - &:hover - text-decoration: none - color: white - background: #8786b7 - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4) - @include radius(2px) - .oe_searchview_custom_delete - display: none - position: absolute - bottom: 1px - right: 4px - .oe_searchview_custom_private, .oe_searchview_custom_public - &:hover - .oe_searchview_custom_delete - display: inline-block - .oe_searchview_custom_public:after - content: "," - font-family: "entypoRegular" !important - font-size: 22px - font-weight: 300 !important - margin: 0 0 0 4px - padding: 0 .oe_searchview_drawer_container overflow: auto @@ -1480,7 +1300,7 @@ $sheet-padding: 16px .col-md-5 padding-left: 0 dl - margin-bottom: 10px + margin-bottom: 0 dt color: $section-title-color font-size: 13px @@ -1527,10 +1347,6 @@ $sheet-padding: 16px button margin: 0 0 8px -3px // Managed margin-left according bootstrap3 .oe_searchview_custom - dt - width: 140px - dd - margin-left: 145px form display: none li diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 2c7ef9948b6..b64b7f21080 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -843,19 +843,16 @@ instance.web.SearchViewDrawer = instance.web.Widget.extend({ // build drawer var in_drawer = this.select_for_drawer(); - var self = this; - var second_col = $('
      '); + var $first_col = this.$(".col-md-7"), + $snd_col = this.$(".col-md-5"); - var insert_first_col = in_drawer[0].appendTo(this.$el).then(function () { - second_col.appendTo(self.$el); - }).then(function () { - return $.when.apply(null, - _(_.rest(in_drawer)).invoke('appendTo', second_col)); - }); - - return $.when.apply(null, _(this.inputs).invoke( + var add_custom_reports = in_drawer[0].appendTo($first_col), + add_filters = in_drawer[1].appendTo($first_col), + add_rest = $.when.apply(null, _(in_drawer.slice(2)).invoke('appendTo', $snd_col)), + defaults_fetched = $.when.apply(null, _(this.inputs).invoke( 'facet_for_defaults', this.searchview.defaults)); + return $.when(add_custom_reports, add_filters, add_rest, defaults_fetched); }, notify_searchview: function () { var defaults = arguments[1]; @@ -943,10 +940,11 @@ instance.web.SearchViewDrawer = instance.web.Widget.extend({ }, add_common_inputs: function() { + // add custom filters to this.inputs + this.custom_filters = new instance.web.search.CustomReports(this); // add Filters to this.inputs, need view.controls filled (new instance.web.search.Filters(this)); - // add custom filters to this.inputs - this.custom_filters = new instance.web.search.CustomFilters(this); + (new instance.web.search.SaveFilter(this, this.custom_filters)); // add Advanced to this.inputs (new instance.web.search.Advanced(this)); }, @@ -1707,12 +1705,12 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({ } }); -instance.web.search.CustomFilters = instance.web.search.Input.extend({ - template: 'SearchView.CustomFilters', +instance.web.search.CustomReports = instance.web.search.Input.extend({ + template: 'SearchView.CustomReports', _in_drawer: true, init: function () { this.is_ready = $.Deferred(); - this._super.apply(this, arguments); + this._super.apply(this,arguments); }, start: function () { var self = this; @@ -1727,13 +1725,6 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ self.clear_selection(); }) .on('reset', this.proxy('clear_selection')); - this.$el.on('submit', 'form', this.proxy('save_current')); - this.$el.on('click', 'input[type=checkbox]', function() { - $(this).siblings('input[type=checkbox]').prop('checked', false); - }); - this.$el.on('click', 'h4', function () { - self.$el.toggleClass('oe_opened'); - }); return this.model.call('get_filters', [this.view.model]) .then(this.proxy('set_filters')) .done(function () { self.is_ready.resolve(); }) @@ -1843,6 +1834,26 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ set_filters: function (filters) { _(filters).map(_.bind(this.append_filter, this)); }, +}); + +instance.web.search.SaveFilter = instance.web.search.Input.extend({ + template: 'SearchView.SaveFilter', + _in_drawer: true, + init: function (parent, custom_reports) { + this._super(parent); + this.custom_reports = custom_reports; + }, + start: function () { + var self = this; + this.model = new instance.web.Model('ir.filters'); + this.$el.on('submit', 'form', this.proxy('save_current')); + this.$el.on('click', 'input[type=checkbox]', function() { + $(this).siblings('input[type=checkbox]').prop('checked', false); + }); + this.$el.on('click', 'h4', function () { + self.$el.toggleClass('oe_opened'); + }); + }, save_current: function () { var self = this; var $name = this.$('input:first'); @@ -1879,14 +1890,16 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ // FIXME: current context? return self.model.call('create_or_replace', [filter]).done(function (id) { filter.id = id; - self.append_filter(filter); + if (self.custom_reports) { + self.custom_reports.append_filter(filter); + } self.$el .removeClass('oe_opened') .find('form')[0].reset(); }); }); return false; - } + }, }); instance.web.search.Filters = instance.web.search.Input.extend({ diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 93f6ee924f7..e9ade4d14a5 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1562,6 +1562,8 @@
      -
      +
      -
      + +
      -
      M Custom Filters
      +
      M Custom Reports
        +
        + +

        Save current filter

        From 36471c395596fb40727c7f5fa8e38431a24e6375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 21 May 2014 14:27:17 +0200 Subject: [PATCH 10/48] [FIX] correctly loads default filters (addon web) also, hide/show the custom reports list when it is empty/non empty --- addons/web/static/src/js/search.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index b64b7f21080..48a8ab05f4b 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -852,10 +852,10 @@ instance.web.SearchViewDrawer = instance.web.Widget.extend({ defaults_fetched = $.when.apply(null, _(this.inputs).invoke( 'facet_for_defaults', this.searchview.defaults)); - return $.when(add_custom_reports, add_filters, add_rest, defaults_fetched); + return $.when(defaults_fetched, add_custom_reports, add_filters, add_rest); }, notify_searchview: function () { - var defaults = arguments[1]; + var defaults = arguments[1][0]; this.ready.resolve.apply(null, defaults); }, /** @@ -1809,6 +1809,9 @@ instance.web.search.CustomReports = instance.web.search.Input.extend({ $filter.remove(); delete self.$filters[key]; delete self.filters[key]; + if (!self.filters.length) { + self.hide(); + } }); }) .appendTo($filter); @@ -1817,6 +1820,7 @@ instance.web.search.CustomReports = instance.web.search.Input.extend({ this.$filters[key].unbind('click').click(function () { self.toggle_filter(filter); }); + this.show(); }, toggle_filter: function (filter, preventSearch) { var current = this.view.query.find(function (facet) { @@ -1833,6 +1837,15 @@ instance.web.search.CustomReports = instance.web.search.Input.extend({ }, set_filters: function (filters) { _(filters).map(_.bind(this.append_filter, this)); + if (!filters.length) { + this.hide(); + } + }, + hide: function () { + this.$el.hide(); + }, + show: function () { + this.$el.show(); }, }); From 8159f4a18c129cb71e40f9902458d7b4d17d4a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 22 May 2014 09:55:04 +0200 Subject: [PATCH 11/48] [IMP] improves searchview appendTo after some thought, the extra method insert was not really necessary. It was at first a way to force the user to give two nodes to determine where the searchview and the drawer were to be inserted. However, the second node can be omitted, a perfectly reasonable default is to append the drawer just after the searchview. Then, the role of insert is exactly the same as appendTo, so it makes sense to override appendTo and remove insert. Simpler, and the job is done. --- addons/mail/static/src/js/mail.js | 2 +- addons/web/static/src/js/search.js | 38 +++++++++------------------ addons/web/static/src/js/view_form.js | 2 +- addons/web/static/src/js/views.js | 2 +- 4 files changed, 16 insertions(+), 28 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index cb01efae515..c53168318a1 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -1889,7 +1889,7 @@ openerp.mail = function (session) { var ds_msg = new session.web.DataSetSearch(this, 'mail.message'); this.searchview = new session.web.SearchView(this, ds_msg, false, defaults || {}, false); - this.searchview.insert(this.$('.oe_view_manager_view_search'), + this.searchview.appendTo(this.$('.oe_view_manager_view_search'), this.$('.oe_searchview_drawer_container')) .then(function () { self.searchview.on('search_data', self, self.do_searchview_search); }); if (this.searchview.has_defaults) { diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 48a8ab05f4b..6c07a2f0c86 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -427,15 +427,15 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea var view_manager = this.getParent(); while (!(view_manager instanceof instance.web.ViewManager) && - (view_manager !== undefined)) { + view_manager && view_manager.getParent) { view_manager = view_manager.getParent(); } if (view_manager) { view_manager.on('switch_mode', this, function (e) { - self.drawer.hide(); + self.drawer.toggle(e === 'graph'); }); - } + } return $.when(p, this.ready); }, @@ -783,22 +783,14 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea this.trigger('invalid_search', errors); }, - // The method appendTo is overwrited to make sure that the search view is not - // appendTo'ed. Instead, the correct way to insert the searchview in the DOM - // is by using insert - appendTo: function () { - throw new Error("SearchView should be inserted, not appended"); - }, + // The method appendTo is overwrited to be able to insert the drawer anywhere + appendTo: function ($searchview_parent, $searchview_drawer_node) { + var $searchview_drawer_node = $searchview_drawer_node || $searchview_parent; - // This is the correct way to insert the searchview in the dom. First argument - // is for the searchview, and second is the place where the drawer should be - // appended. - insert: function ($searchview_parent, $searchview_drawer_node) { - var parent = this.getParent(), - $searchview_drawer_node = $searchview_drawer_node || $searchview_parent, - insert_searchview = parent.appendTo.call(this, $searchview_parent), - insert_drawer = parent.appendTo.call(this.drawer, $searchview_drawer_node); - return $.when(insert_searchview, insert_drawer); + return $.when( + this._super($searchview_parent), + this.drawer.appendTo($searchview_drawer_node) + ); }, destroy: function () { @@ -819,12 +811,8 @@ instance.web.SearchViewDrawer = instance.web.Widget.extend({ this.inputs = []; }, - toggle: function () { - this.$el.toggle(); - }, - - hide: function () { - this.$el.hide(); + toggle: function (visibility) { + this.$el.toggle(visibility); }, start: function() { @@ -1011,7 +999,7 @@ instance.web.search.Widget = instance.web.Widget.extend( /** @lends instance.web this.drawer = ancestor; } while (!(ancestor instanceof instance.web.SearchViewDrawer) && (ancestor = (ancestor.getParent && ancestor.getParent()))); - this.view = this.drawer.searchview; + this.view = this.drawer.searchview || this.drawer; } }); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 797ecd0e807..b57ddbac345 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5346,7 +5346,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend }); }); }); - this.searchview.insert(this.$(".oe_popup_search")); + this.searchview.appendTo(this.$(".oe_popup_search")); }, do_search: function(domains, contexts, groupbys) { var self = this; diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 8f01c4775c2..4cbf036e9f3 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -808,7 +808,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ this.searchview = new instance.web.SearchView(this, this.dataset, view_id, search_defaults, options); this.searchview.on('search_data', self, this.do_searchview_search); - return this.searchview.insert(this.$(".oe_view_manager_view_search"), + return this.searchview.appendTo(this.$(".oe_view_manager_view_search"), this.$(".oe_searchview_drawer_container")); }, do_searchview_search: function(domains, contexts, groupbys) { From a24020e0047dccf0fad8f8d424558d933116742b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 22 May 2014 09:59:32 +0200 Subject: [PATCH 12/48] [FIX] update the searchview tests to accomodate the fact that the searchview has been changed. Two changes need to be accounted: (1) the drawer html structure has changed (oe_selected class is replaced by badge, some li tags are replaced by spans, ...) and (2) the CustomFilters has been split into CustomReports and SaveFilter, so there is an extra filter in the drawer inputs. Also, the searchview need a parent to react to the switch_mode event, so the tests add a fake parent to the view in make_search_view --- addons/web/static/test/search.js | 47 ++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/addons/web/static/test/search.js b/addons/web/static/test/search.js index 96bbb660103..9104f4dfbfe 100644 --- a/addons/web/static/test/search.js +++ b/addons/web/static/test/search.js @@ -173,7 +173,9 @@ var makeSearchView = function (instance, dummy_widget_attributes, defaults) { }; var dataset = new instance.web.DataSet(null, 'dummy.model'); - var view = new instance.web.SearchView(null, dataset, false, defaults); + var mock_parent = {getParent: function () {return null;}}; + + var view = new instance.web.SearchView(mock_parent, dataset, false, defaults); var self = this; view.on('invalid_search', self, function () { ok(false, JSON.stringify([].slice(arguments))); @@ -1071,10 +1073,10 @@ openerp.testing.section('search.filters', { return view.appendTo($fix) .done(function () { var $fs = $fix.find('.oe_searchview_filters ul'); - // 3 filters, 1 filtergroup, 1 custom filters widget, - // 1 advanced and 1 Filters widget - equal(view.inputs.length, 7, - 'view should have 7 inputs total'); + // 3 filters, 1 filtergroup, 1 custom report widget, + // 1 Filters, 1 SaveFilter widget, and 1 advanced + equal(view.drawer.inputs.length, 8, + 'view should have 8 inputs total'); equal($fs.children().length, 3, "drawer should have a filter group with 3 filters"); equal(_.str.strip($fs.children().eq(0).text()), "Foo1", @@ -1159,14 +1161,15 @@ openerp.testing.section('search.groupby', { return view.appendTo($fix) .done(function () { // 3 filters, 1 filtergroup group, 1 custom filter, 1 advanced, 1 Filters - equal(view.inputs.length, 7, - 'should have 7 inputs total'); - var group = _.find(view.inputs, function (f) { + // and 1 SaveFilter widget + equal(view.drawer.inputs.length, 8, + 'should have 8 inputs total'); + var group = _.find(view.drawer.inputs, function (f) { return f instanceof instance.web.search.GroupbyGroup; }); ok(group, "should have a GroupbyGroup input"); - ok(group.getParent() === view, - "group's parent should be view"); + ok(group.getParent() === view.drawer, + "group's parent should be the drawer"); group.toggle(group.filters[0]); group.toggle(group.filters[2]); @@ -1208,9 +1211,10 @@ openerp.testing.section('search.groupby', { return view.appendTo($fix) .done(function () { // 3 filters, 3 filtergroups, 1 custom filter, 1 advanced, 1 Filters - equal(view.inputs.length, 9, "should have 9 inputs total"); + // and 1 SaveFilter widget + equal(view.drawer.inputs.length, 10, "should have 10 inputs total"); - var groups = _.filter(view.inputs, function (f) { + var groups = _.filter(view.drawer.inputs, function (f) { return f instanceof instance.web.search.GroupbyGroup; }); equal(groups.length, 3, "should have 3 GroupbyGroups"); @@ -1242,10 +1246,10 @@ openerp.testing.section('search.filters.saved', { return view.appendTo($fix) .done(function () { - var $row = $fix.find('.oe_searchview_custom li:first').click(); + var $span = $fix.find('.oe_searchview_custom_list span:first').click(); - ok($row.hasClass('oe_selected'), "should check/select the filter's row"); - ok($row.hasClass("oe_searchview_custom_private"), + ok($span.hasClass('badge'), "should check/select the filter's row"); + ok($span.hasClass("oe_searchview_custom_private"), "should have private filter note/class"); equal(view.query.length, 1, "should have only one facet"); var values = view.query.at(0).values; @@ -1268,7 +1272,7 @@ openerp.testing.section('search.filters.saved', { var $row = $fix.find('.oe_searchview_custom li:first').click(); view.query.remove(view.query.at(0)); - ok(!$row.hasClass('oe_selected'), + ok(!$row.hasClass('badge'), "should not be checked anymore"); }); }); @@ -1280,7 +1284,7 @@ openerp.testing.section('search.filters.saved', { return view.appendTo($fix) .done(function () { - var $row = $fix.find('.oe_searchview_custom li:first').click(); + var $row = $fix.find('.oe_searchview_custom_list span:first').click(); equal(view.query.length, 1, "should have one facet"); $row.click(); equal(view.query.length, 0, "should have removed facet"); @@ -1296,13 +1300,13 @@ openerp.testing.section('search.filters.saved', { }); return view.appendTo($fix) .done(function () { - $fix.find('.oe_searchview_custom li:eq(0)').click(); + $fix.find('.oe_searchview_custom_list span:eq(0)').click(); equal(view.query.length, 1, "should have one facet"); deepEqual( view.query.at(0).get('field').get_context(), {'private': 1}, "should have selected first filter"); - $fix.find('.oe_searchview_custom li:eq(1)').click(); + $fix.find('.oe_searchview_custom_list span:eq(1)').click(); equal(view.query.length, 1, "should have one facet"); deepEqual( view.query.at(0).get('field').get_context(), @@ -1529,10 +1533,10 @@ openerp.testing.section('search.invisible', { ].join('')); return view.appendTo($fix) .then(function () { - strictEqual($fix.find('.oe_searchview_filters h3').length, + strictEqual($fix.find('.oe_searchview_filters dt').length, 1, "should only display one group"); - strictEqual($fix.find('.oe_searchview_filters h3').text(), + strictEqual($fix.find('.oe_searchview_filters dt').text(), 'w Visibles', "should only display the Visibles group (and its icon char)"); @@ -1588,3 +1592,4 @@ openerp.testing.section('search.invisible', { }); }); }); + From 555677f14d0421f4e474d489e19cc7c9cdb9c6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 22 May 2014 11:44:35 +0200 Subject: [PATCH 13/48] [IMP] replace all 'Group By...' by 'Group By' in all searchview, the 'Group By...' looks weird, next to the Custom Reports and Filters. This change was requested by the upper management --- addons/account/account_invoice_view.xml | 2 +- addons/account/account_view.xml | 28 +++++++++---------- addons/account/project/project_view.xml | 6 ++-- .../account_analytic_entries_report_view.xml | 2 +- .../report/account_entries_report_view.xml | 2 +- .../report/account_invoice_report_view.xml | 2 +- .../account_analytic_analysis_view.xml | 2 +- .../account_analytic_default_view.xml | 2 +- .../report/account_asset_report_view.xml | 2 +- .../account_bank_statement_view.xml | 2 +- .../account_followup_customers.xml | 2 +- .../report/account_followup_report.xml | 2 +- .../account_payment/account_payment_view.xml | 4 +-- .../account_voucher/account_voucher_view.xml | 2 +- .../account_voucher_sales_receipt_view.xml | 2 +- .../voucher_payment_receipt_view.xml | 4 +-- .../voucher_sales_purchase_view.xml | 4 +-- addons/calendar/base_calendar_view.xml | 2 +- addons/calendar/calendar_view.xml | 2 +- addons/crm/crm_case_section_view.xml | 2 +- addons/crm/crm_lead_view.xml | 4 +-- addons/crm/crm_phonecall_view.xml | 2 +- addons/crm/report/crm_lead_report_view.xml | 2 +- .../crm/report/crm_phonecall_report_view.xml | 2 +- addons/crm_claim/crm_claim_view.xml | 2 +- .../report/crm_claim_report_view.xml | 2 +- addons/crm_helpdesk/crm_helpdesk_view.xml | 2 +- .../report/crm_helpdesk_report_view.xml | 2 +- .../report/crm_lead_report_view.xml | 2 +- .../report/crm_partner_report_view.xml | 2 +- addons/document/document_view.xml | 2 +- addons/event/event_view.xml | 4 +-- .../report/report_event_registration_view.xml | 2 +- addons/fleet/fleet_view.xml | 10 +++---- addons/gamification/views/challenge.xml | 2 +- addons/gamification/views/goal.xml | 4 +-- addons/hr/hr_view.xml | 4 +-- addons/hr_attendance/hr_attendance_view.xml | 2 +- addons/hr_contract/hr_contract_view.xml | 2 +- addons/hr_evaluation/hr_evaluation_view.xml | 4 +-- .../report/hr_evaluation_report_view.xml | 2 +- addons/hr_expense/hr_expense_view.xml | 2 +- .../report/hr_expense_report_view.xml | 2 +- addons/hr_holidays/hr_holidays_view.xml | 2 +- addons/hr_payroll/hr_payroll_view.xml | 6 ++-- addons/hr_recruitment/hr_recruitment_view.xml | 2 +- addons/hr_timesheet/hr_timesheet_view.xml | 2 +- .../hr_timesheet_invoice_report_view.xml | 2 +- .../hr_timesheet_sheet_view.xml | 2 +- .../report/hr_timesheet_report_view.xml | 2 +- .../report/timesheet_report_view.xml | 2 +- addons/im_livechat/im_livechat_view.xml | 2 +- addons/l10n_be_coda/l10n_be_coda_view.xml | 2 +- .../l10n_in_hr_payroll_view.xml | 2 +- .../report/payment_advice_report_view.xml | 2 +- .../report/payslip_report_view.xml | 2 +- addons/lunch/lunch_view.xml | 4 +-- addons/mail/mail_alias_view.xml | 2 +- addons/mail/mail_mail_view.xml | 2 +- addons/mail/mail_message_view.xml | 2 +- .../marketing_campaign_view.xml | 6 ++-- .../report/campaign_analysis_view.xml | 2 +- addons/mass_mailing/views/mass_mailing.xml | 6 ++-- addons/membership/membership_view.xml | 2 +- .../report/report_membership_view.xml | 2 +- addons/mrp/mrp_view.xml | 10 +++---- addons/mrp_operations/mrp_operations_view.xml | 2 +- .../report/mrp_workorder_analysis_view.xml | 2 +- addons/mrp_repair/mrp_repair_view.xml | 2 +- addons/note/note_view.xml | 2 +- addons/payment/views/payment_acquirer.xml | 2 +- .../point_of_sale/account_statement_view.xml | 4 +-- addons/point_of_sale/point_of_sale_view.xml | 6 ++-- .../report/pos_order_report_view.xml | 2 +- addons/project/project_view.xml | 4 +-- addons/project/report/project_report_view.xml | 2 +- addons/project_issue/project_issue_view.xml | 2 +- .../report/project_issue_report_view.xml | 2 +- .../report/task_report_view.xml | 2 +- addons/purchase/purchase_view.xml | 6 ++-- .../purchase/report/purchase_report_view.xml | 2 +- .../purchase_requisition_view.xml | 2 +- addons/resource/resource_view.xml | 4 +-- addons/sale/report/sale_report_view.xml | 2 +- addons/sale/sale_view.xml | 6 ++-- addons/stock/stock_view.xml | 10 +++---- .../wizard/stock_valuation_history_view.xml | 2 +- .../stock_landed_costs_view.xml | 2 +- .../stock_picking_wave_view.xml | 2 +- addons/subscription/subscription_view.xml | 2 +- addons/survey/views/survey_views.xml | 8 +++--- .../website_blog/views/website_blog_views.xml | 2 +- .../views/website_certification_views.xml | 2 +- .../views/event_backend.xml | 2 +- addons/website_forum/views/forum.xml | 2 +- doc/03_module_dev_03.rst | 2 +- openerp/addons/base/ir/ir_attachment_view.xml | 2 +- openerp/addons/base/ir/ir_cron_view.xml | 2 +- openerp/addons/base/ir/ir_filters.xml | 2 +- openerp/addons/base/ir/ir_logging_view.xml | 2 +- openerp/addons/base/ir/ir_model_view.xml | 6 ++-- openerp/addons/base/ir/ir_ui_view_view.xml | 2 +- openerp/addons/base/ir/ir_values_view.xml | 2 +- openerp/addons/base/module/module_view.xml | 2 +- openerp/addons/base/res/res_partner_view.xml | 2 +- .../addons/base/workflow/workflow_view.xml | 2 +- 106 files changed, 162 insertions(+), 162 deletions(-) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 61c397364b9..29692992341 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -462,7 +462,7 @@ - + diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 8e2cc6452c0..4f3b5f43945 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -61,7 +61,7 @@ - + @@ -232,7 +232,7 @@ - + @@ -381,7 +381,7 @@ - + @@ -500,7 +500,7 @@ - + @@ -536,7 +536,7 @@ - + @@ -895,7 +895,7 @@ - + @@ -1175,7 +1175,7 @@ - + @@ -1408,7 +1408,7 @@ - + @@ -1565,7 +1565,7 @@ - + @@ -1699,7 +1699,7 @@ - + @@ -1856,7 +1856,7 @@ - + @@ -1935,7 +1935,7 @@ - + @@ -2078,7 +2078,7 @@ - + @@ -2485,7 +2485,7 @@ - + diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 6e25c46168f..0bdaa107ad9 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -37,7 +37,7 @@ - + @@ -198,7 +198,7 @@ - + @@ -306,7 +306,7 @@ - + diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml index 1d2e87be339..ee7bc934ce3 100644 --- a/addons/account/report/account_analytic_entries_report_view.xml +++ b/addons/account/report/account_analytic_entries_report_view.xml @@ -11,7 +11,7 @@ - + diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml index 2d1af681062..dbff131388d 100644 --- a/addons/account/report/account_entries_report_view.xml +++ b/addons/account/report/account_entries_report_view.xml @@ -83,7 +83,7 @@ - + diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index eebc95ae0e2..01e3dc72d68 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -35,7 +35,7 @@ - + diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index 97fb15e9290..11db5214975 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -238,7 +238,7 @@ - + diff --git a/addons/account_analytic_default/account_analytic_default_view.xml b/addons/account_analytic_default/account_analytic_default_view.xml index 38f51a9ef20..bfd7e333c56 100644 --- a/addons/account_analytic_default/account_analytic_default_view.xml +++ b/addons/account_analytic_default/account_analytic_default_view.xml @@ -49,7 +49,7 @@ - + diff --git a/addons/account_asset/report/account_asset_report_view.xml b/addons/account_asset/report/account_asset_report_view.xml index 19299eee501..ff6f0b0d52d 100644 --- a/addons/account_asset/report/account_asset_report_view.xml +++ b/addons/account_asset/report/account_asset_report_view.xml @@ -33,7 +33,7 @@ - + diff --git a/addons/account_bank_statement_extensions/account_bank_statement_view.xml b/addons/account_bank_statement_extensions/account_bank_statement_view.xml index d64eb68bc99..408ed8a8f67 100644 --- a/addons/account_bank_statement_extensions/account_bank_statement_view.xml +++ b/addons/account_bank_statement_extensions/account_bank_statement_view.xml @@ -135,7 +135,7 @@ - + diff --git a/addons/account_followup/account_followup_customers.xml b/addons/account_followup/account_followup_customers.xml index 9565cdcc21f..ef36d86f98f 100644 --- a/addons/account_followup/account_followup_customers.xml +++ b/addons/account_followup/account_followup_customers.xml @@ -51,7 +51,7 @@ - + diff --git a/addons/account_followup/report/account_followup_report.xml b/addons/account_followup/report/account_followup_report.xml index e435e58da7b..e3f4ec6f8e9 100644 --- a/addons/account_followup/report/account_followup_report.xml +++ b/addons/account_followup/report/account_followup_report.xml @@ -26,7 +26,7 @@ help = "Including journal entries marked as a litigation"/> - + diff --git a/addons/account_payment/account_payment_view.xml b/addons/account_payment/account_payment_view.xml index d62a7969754..b954755b43d 100644 --- a/addons/account_payment/account_payment_view.xml +++ b/addons/account_payment/account_payment_view.xml @@ -12,7 +12,7 @@ - + @@ -177,7 +177,7 @@ - + diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index a5885156442..02dbfc33175 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -132,7 +132,7 @@ - + diff --git a/addons/account_voucher/report/account_voucher_sales_receipt_view.xml b/addons/account_voucher/report/account_voucher_sales_receipt_view.xml index 38b5423a7d6..a6e153573e7 100644 --- a/addons/account_voucher/report/account_voucher_sales_receipt_view.xml +++ b/addons/account_voucher/report/account_voucher_sales_receipt_view.xml @@ -57,7 +57,7 @@ - + diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 1169d5ef7c3..6404a6ea932 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -14,7 +14,7 @@ - + @@ -37,7 +37,7 @@ - + diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index 97f96f75901..c29c4e0f757 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -13,7 +13,7 @@ - + @@ -35,7 +35,7 @@ - + diff --git a/addons/calendar/base_calendar_view.xml b/addons/calendar/base_calendar_view.xml index 3ef2c8f59ce..f2001fec39f 100644 --- a/addons/calendar/base_calendar_view.xml +++ b/addons/calendar/base_calendar_view.xml @@ -260,7 +260,7 @@ - + diff --git a/addons/calendar/calendar_view.xml b/addons/calendar/calendar_view.xml index 4c17e3e8e70..dcb0e24c84d 100644 --- a/addons/calendar/calendar_view.xml +++ b/addons/calendar/calendar_view.xml @@ -260,7 +260,7 @@ - + diff --git a/addons/crm/crm_case_section_view.xml b/addons/crm/crm_case_section_view.xml index 04ad124f652..d8aee8a063b 100644 --- a/addons/crm/crm_case_section_view.xml +++ b/addons/crm/crm_case_section_view.xml @@ -154,7 +154,7 @@ - + diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 2441e4197c4..8264f469907 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -351,7 +351,7 @@ name='not_opt_out' domain="[('opt_out', '=', False)]" help="Leads that did not ask not to be included in mass mailing campaigns"/> - + @@ -573,7 +573,7 @@ help="Opportunities that are assigned to any sales teams I am member of"/> - + diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml index f51cd847c6b..4f703928947 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -186,7 +186,7 @@ - + diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml index 1dda471c2f2..08748356c6d 100644 --- a/addons/crm/report/crm_lead_report_view.xml +++ b/addons/crm/report/crm_lead_report_view.xml @@ -79,7 +79,7 @@ - + diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml index 32ae9704064..9b097d2c978 100644 --- a/addons/crm/report/crm_phonecall_report_view.xml +++ b/addons/crm/report/crm_phonecall_report_view.xml @@ -45,7 +45,7 @@ - + diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml index b6d43c4b140..3df91bb5344 100644 --- a/addons/crm_claim/crm_claim_view.xml +++ b/addons/crm_claim/crm_claim_view.xml @@ -191,7 +191,7 @@ - + diff --git a/addons/crm_claim/report/crm_claim_report_view.xml b/addons/crm_claim/report/crm_claim_report_view.xml index 710603af10a..bdae622f408 100644 --- a/addons/crm_claim/report/crm_claim_report_view.xml +++ b/addons/crm_claim/report/crm_claim_report_view.xml @@ -44,7 +44,7 @@ - + diff --git a/addons/crm_helpdesk/crm_helpdesk_view.xml b/addons/crm_helpdesk/crm_helpdesk_view.xml index 464e33973b6..b8a0305dcfe 100644 --- a/addons/crm_helpdesk/crm_helpdesk_view.xml +++ b/addons/crm_helpdesk/crm_helpdesk_view.xml @@ -143,7 +143,7 @@ - + diff --git a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml index 4a3ee4e92e3..adc788ad505 100644 --- a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml +++ b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml @@ -42,7 +42,7 @@ - + diff --git a/addons/crm_partner_assign/report/crm_lead_report_view.xml b/addons/crm_partner_assign/report/crm_lead_report_view.xml index 271c9b2016f..760b86b7877 100644 --- a/addons/crm_partner_assign/report/crm_lead_report_view.xml +++ b/addons/crm_partner_assign/report/crm_lead_report_view.xml @@ -22,7 +22,7 @@ - + diff --git a/addons/crm_partner_assign/report/crm_partner_report_view.xml b/addons/crm_partner_assign/report/crm_partner_report_view.xml index 02320219218..b8a2c4c5366 100644 --- a/addons/crm_partner_assign/report/crm_partner_report_view.xml +++ b/addons/crm_partner_assign/report/crm_partner_report_view.xml @@ -12,7 +12,7 @@ - + diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index b735d2ce4a4..3f80c8f2334 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -110,7 +110,7 @@ - + diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index cc6edfbd9bd..fba7424ff95 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -279,7 +279,7 @@ - + @@ -435,7 +435,7 @@ - + diff --git a/addons/event/report/report_event_registration_view.xml b/addons/event/report/report_event_registration_view.xml index ed0124b5459..faa484d5667 100644 --- a/addons/event/report/report_event_registration_view.xml +++ b/addons/event/report/report_event_registration_view.xml @@ -32,7 +32,7 @@ - + diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index e4cdbe886f7..32d2ab201d4 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -61,7 +61,7 @@ - + @@ -329,7 +329,7 @@ - + @@ -610,7 +610,7 @@ - + @@ -716,7 +716,7 @@ - + @@ -924,7 +924,7 @@ - + diff --git a/addons/gamification/views/challenge.xml b/addons/gamification/views/challenge.xml index 98e31331290..6faa40eacb5 100644 --- a/addons/gamification/views/challenge.xml +++ b/addons/gamification/views/challenge.xml @@ -223,7 +223,7 @@ - + diff --git a/addons/gamification/views/goal.xml b/addons/gamification/views/goal.xml index 884467404ce..c0d9a3bd5b7 100644 --- a/addons/gamification/views/goal.xml +++ b/addons/gamification/views/goal.xml @@ -110,7 +110,7 @@ - + @@ -274,7 +274,7 @@ - + diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 41f2bba0073..f6c5e427548 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -121,7 +121,7 @@ - + @@ -394,7 +394,7 @@ - + diff --git a/addons/hr_attendance/hr_attendance_view.xml b/addons/hr_attendance/hr_attendance_view.xml index ae8a168a595..074a3545f5c 100644 --- a/addons/hr_attendance/hr_attendance_view.xml +++ b/addons/hr_attendance/hr_attendance_view.xml @@ -56,7 +56,7 @@ - + diff --git a/addons/hr_contract/hr_contract_view.xml b/addons/hr_contract/hr_contract_view.xml index f97aefd70ed..13d64c59f1a 100644 --- a/addons/hr_contract/hr_contract_view.xml +++ b/addons/hr_contract/hr_contract_view.xml @@ -62,7 +62,7 @@ - + diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index 7e41830545a..91b9e85042d 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -9,7 +9,7 @@ - + @@ -333,7 +333,7 @@ - + diff --git a/addons/hr_evaluation/report/hr_evaluation_report_view.xml b/addons/hr_evaluation/report/hr_evaluation_report_view.xml index 456b5ab72f9..073e648fe98 100644 --- a/addons/hr_evaluation/report/hr_evaluation_report_view.xml +++ b/addons/hr_evaluation/report/hr_evaluation_report_view.xml @@ -30,7 +30,7 @@ - + diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml index 457d8f33a07..a3f8f66e141 100644 --- a/addons/hr_expense/hr_expense_view.xml +++ b/addons/hr_expense/hr_expense_view.xml @@ -162,7 +162,7 @@ - + diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml index f2ba5290c96..5655b965f7c 100644 --- a/addons/hr_expense/report/hr_expense_report_view.xml +++ b/addons/hr_expense/report/hr_expense_report_view.xml @@ -35,7 +35,7 @@ - + diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index a15a18d20aa..9eccfbef9ce 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -20,7 +20,7 @@ - + diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml index 0f461842355..b2f6e2e31bf 100644 --- a/addons/hr_payroll/hr_payroll_view.xml +++ b/addons/hr_payroll/hr_payroll_view.xml @@ -171,7 +171,7 @@ - + @@ -357,7 +357,7 @@ - + @@ -641,7 +641,7 @@ - + diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index b71e61d5c9c..518b698e028 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -208,7 +208,7 @@ - + diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml index 94af1bc3b96..26fb1d24c69 100644 --- a/addons/hr_timesheet/hr_timesheet_view.xml +++ b/addons/hr_timesheet/hr_timesheet_view.xml @@ -70,7 +70,7 @@ - + diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml index 6d6fe2f3776..537514b8db5 100644 --- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml +++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml @@ -51,7 +51,7 @@ - + diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml index a60afda8531..2dd4dea7b2b 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml @@ -184,7 +184,7 @@ - + diff --git a/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml index 8e06530ee9b..30757a0b43e 100644 --- a/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml +++ b/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml @@ -28,7 +28,7 @@ - + diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml index a85b17b88af..9b45229c2cc 100644 --- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml +++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml @@ -35,7 +35,7 @@ - + diff --git a/addons/im_livechat/im_livechat_view.xml b/addons/im_livechat/im_livechat_view.xml index 249021e25e8..e4ea10201e2 100644 --- a/addons/im_livechat/im_livechat_view.xml +++ b/addons/im_livechat/im_livechat_view.xml @@ -150,7 +150,7 @@ - + diff --git a/addons/l10n_be_coda/l10n_be_coda_view.xml b/addons/l10n_be_coda/l10n_be_coda_view.xml index e7b4c02ef70..64249bcb0e1 100644 --- a/addons/l10n_be_coda/l10n_be_coda_view.xml +++ b/addons/l10n_be_coda/l10n_be_coda_view.xml @@ -73,7 +73,7 @@ - + diff --git a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml index d65f02a332b..0a1432b5511 100644 --- a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml +++ b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml @@ -144,7 +144,7 @@ - + diff --git a/addons/l10n_in_hr_payroll/report/payment_advice_report_view.xml b/addons/l10n_in_hr_payroll/report/payment_advice_report_view.xml index 38f1272718b..300d7932bc3 100644 --- a/addons/l10n_in_hr_payroll/report/payment_advice_report_view.xml +++ b/addons/l10n_in_hr_payroll/report/payment_advice_report_view.xml @@ -54,7 +54,7 @@ - + diff --git a/addons/l10n_in_hr_payroll/report/payslip_report_view.xml b/addons/l10n_in_hr_payroll/report/payslip_report_view.xml index d71cb283336..8293b26a7f3 100644 --- a/addons/l10n_in_hr_payroll/report/payslip_report_view.xml +++ b/addons/l10n_in_hr_payroll/report/payslip_report_view.xml @@ -50,7 +50,7 @@ - + diff --git a/addons/lunch/lunch_view.xml b/addons/lunch/lunch_view.xml index cb7ad61e928..dec7734be76 100644 --- a/addons/lunch/lunch_view.xml +++ b/addons/lunch/lunch_view.xml @@ -21,7 +21,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/addons/mail/mail_alias_view.xml b/addons/mail/mail_alias_view.xml index 248bf7e8f3a..5445fb8ff1c 100644 --- a/addons/mail/mail_alias_view.xml +++ b/addons/mail/mail_alias_view.xml @@ -60,7 +60,7 @@ - + diff --git a/addons/mail/mail_mail_view.xml b/addons/mail/mail_mail_view.xml index 1eec45843c3..a820a249f2e 100644 --- a/addons/mail/mail_mail_view.xml +++ b/addons/mail/mail_mail_view.xml @@ -108,7 +108,7 @@ - + diff --git a/addons/mail/mail_message_view.xml b/addons/mail/mail_message_view.xml index 1c4a7f55c10..18b3dc8cc79 100644 --- a/addons/mail/mail_message_view.xml +++ b/addons/mail/mail_message_view.xml @@ -71,7 +71,7 @@ - + diff --git a/addons/marketing_campaign/marketing_campaign_view.xml b/addons/marketing_campaign/marketing_campaign_view.xml index dc4d989ee5b..254f88c727c 100644 --- a/addons/marketing_campaign/marketing_campaign_view.xml +++ b/addons/marketing_campaign/marketing_campaign_view.xml @@ -150,7 +150,7 @@ - + @@ -254,7 +254,7 @@ - + @@ -435,7 +435,7 @@ - + diff --git a/addons/marketing_campaign/report/campaign_analysis_view.xml b/addons/marketing_campaign/report/campaign_analysis_view.xml index d3693497408..26cfa050248 100644 --- a/addons/marketing_campaign/report/campaign_analysis_view.xml +++ b/addons/marketing_campaign/report/campaign_analysis_view.xml @@ -38,7 +38,7 @@ - + diff --git a/addons/mass_mailing/views/mass_mailing.xml b/addons/mass_mailing/views/mass_mailing.xml index a9cd33f9531..557a13eb250 100644 --- a/addons/mass_mailing/views/mass_mailing.xml +++ b/addons/mass_mailing/views/mass_mailing.xml @@ -30,7 +30,7 @@ - + - + - + - + diff --git a/addons/membership/report/report_membership_view.xml b/addons/membership/report/report_membership_view.xml index ab1b1013e50..39897357add 100644 --- a/addons/membership/report/report_membership_view.xml +++ b/addons/membership/report/report_membership_view.xml @@ -13,7 +13,7 @@ - + - + @@ -216,7 +216,7 @@ - + @@ -310,7 +310,7 @@ - + @@ -425,7 +425,7 @@ - + @@ -850,7 +850,7 @@ help="Production started late"/> - + diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml index d886097585f..3d5700be976 100644 --- a/addons/mrp_operations/mrp_operations_view.xml +++ b/addons/mrp_operations/mrp_operations_view.xml @@ -130,7 +130,7 @@ help="Production started late"/> - + diff --git a/addons/mrp_operations/report/mrp_workorder_analysis_view.xml b/addons/mrp_operations/report/mrp_workorder_analysis_view.xml index 92c6ef9adb2..624ce0a15ab 100644 --- a/addons/mrp_operations/report/mrp_workorder_analysis_view.xml +++ b/addons/mrp_operations/report/mrp_workorder_analysis_view.xml @@ -29,7 +29,7 @@ - + diff --git a/addons/mrp_repair/mrp_repair_view.xml b/addons/mrp_repair/mrp_repair_view.xml index 63db81070d0..8d49a182475 100644 --- a/addons/mrp_repair/mrp_repair_view.xml +++ b/addons/mrp_repair/mrp_repair_view.xml @@ -213,7 +213,7 @@ - + diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 35d4ce316fc..4cd9efe6326 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -135,7 +135,7 @@ - + diff --git a/addons/payment/views/payment_acquirer.xml b/addons/payment/views/payment_acquirer.xml index 0228bd7d17d..58569a325b2 100644 --- a/addons/payment/views/payment_acquirer.xml +++ b/addons/payment/views/payment_acquirer.xml @@ -82,7 +82,7 @@ - + diff --git a/addons/point_of_sale/account_statement_view.xml b/addons/point_of_sale/account_statement_view.xml index 86fc8fec164..d9e9ac0d02c 100644 --- a/addons/point_of_sale/account_statement_view.xml +++ b/addons/point_of_sale/account_statement_view.xml @@ -27,7 +27,7 @@ - + @@ -46,7 +46,7 @@ - + diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index dc8a5850e65..6e84f139b2f 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -153,7 +153,7 @@ - + @@ -832,7 +832,7 @@ - + @@ -883,7 +883,7 @@ - + diff --git a/addons/point_of_sale/report/pos_order_report_view.xml b/addons/point_of_sale/report/pos_order_report_view.xml index 5cef1f92cbf..1d0b31f6c37 100644 --- a/addons/point_of_sale/report/pos_order_report_view.xml +++ b/addons/point_of_sale/report/pos_order_report_view.xml @@ -32,7 +32,7 @@ - + diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index b6a839edcf6..fc6ffe647bb 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -31,7 +31,7 @@ - + @@ -199,7 +199,7 @@ - + diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml index aced63a34d6..e2e68b67116 100644 --- a/addons/project/report/project_report_view.xml +++ b/addons/project/report/project_report_view.xml @@ -42,7 +42,7 @@ - + diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index 4e53c056772..db36e9a8bfa 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -151,7 +151,7 @@ - + diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml index ad6d6688d1e..b7c9fc73e6d 100644 --- a/addons/project_issue/report/project_issue_report_view.xml +++ b/addons/project_issue/report/project_issue_report_view.xml @@ -28,7 +28,7 @@ - + diff --git a/addons/project_timesheet/report/task_report_view.xml b/addons/project_timesheet/report/task_report_view.xml index 37d7b1486f9..b5871324b6b 100644 --- a/addons/project_timesheet/report/task_report_view.xml +++ b/addons/project_timesheet/report/task_report_view.xml @@ -16,7 +16,7 @@ - + diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 499308e0096..2f6e310d817 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -289,7 +289,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -500,7 +500,7 @@ - + diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml index fc171e42efa..37778328bcb 100644 --- a/addons/purchase/report/purchase_report_view.xml +++ b/addons/purchase/report/purchase_report_view.xml @@ -37,7 +37,7 @@ - + diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml index 214505219ea..667ced42392 100644 --- a/addons/purchase_requisition/purchase_requisition_view.xml +++ b/addons/purchase_requisition/purchase_requisition_view.xml @@ -160,7 +160,7 @@ - + diff --git a/addons/resource/resource_view.xml b/addons/resource/resource_view.xml index 752026005a3..579c5dcc1e5 100644 --- a/addons/resource/resource_view.xml +++ b/addons/resource/resource_view.xml @@ -14,7 +14,7 @@ - + @@ -45,7 +45,7 @@ - + diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml index 14b719ebd7a..2fc03887dc2 100644 --- a/addons/sale/report/sale_report_view.xml +++ b/addons/sale/report/sale_report_view.xml @@ -32,7 +32,7 @@ - + diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 402737b4f01..8761ecb1e2f 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -256,7 +256,7 @@ - + @@ -424,7 +424,7 @@ - + @@ -450,7 +450,7 @@ - + diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 06aba6e66ea..7c499fca999 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -62,7 +62,7 @@ - + @@ -244,7 +244,7 @@ - + @@ -791,7 +791,7 @@ - + @@ -1154,7 +1154,7 @@ - + @@ -1506,7 +1506,7 @@ - + diff --git a/addons/stock_account/wizard/stock_valuation_history_view.xml b/addons/stock_account/wizard/stock_valuation_history_view.xml index 276f4a2389d..5f9da6a2907 100644 --- a/addons/stock_account/wizard/stock_valuation_history_view.xml +++ b/addons/stock_account/wizard/stock_valuation_history_view.xml @@ -74,7 +74,7 @@ - + diff --git a/addons/stock_landed_costs/stock_landed_costs_view.xml b/addons/stock_landed_costs/stock_landed_costs_view.xml index be59482a234..3d0f68a2b00 100644 --- a/addons/stock_landed_costs/stock_landed_costs_view.xml +++ b/addons/stock_landed_costs/stock_landed_costs_view.xml @@ -132,7 +132,7 @@ - + diff --git a/addons/stock_picking_wave/stock_picking_wave_view.xml b/addons/stock_picking_wave/stock_picking_wave_view.xml index 2dec7ad4388..9530fba2abf 100644 --- a/addons/stock_picking_wave/stock_picking_wave_view.xml +++ b/addons/stock_picking_wave/stock_picking_wave_view.xml @@ -63,7 +63,7 @@ - + diff --git a/addons/subscription/subscription_view.xml b/addons/subscription/subscription_view.xml index 0504017e991..44017da3517 100644 --- a/addons/subscription/subscription_view.xml +++ b/addons/subscription/subscription_view.xml @@ -75,7 +75,7 @@ domain="[('state','=','running')]"/> - + diff --git a/addons/survey/views/survey_views.xml b/addons/survey/views/survey_views.xml index 0c5d7462447..c6a2111a34b 100644 --- a/addons/survey/views/survey_views.xml +++ b/addons/survey/views/survey_views.xml @@ -15,7 +15,7 @@ - + @@ -271,7 +271,7 @@ - + @@ -380,7 +380,7 @@ - + @@ -481,7 +481,7 @@ - + diff --git a/addons/website_blog/views/website_blog_views.xml b/addons/website_blog/views/website_blog_views.xml index a3a359a1f62..56c6ecfe573 100644 --- a/addons/website_blog/views/website_blog_views.xml +++ b/addons/website_blog/views/website_blog_views.xml @@ -87,7 +87,7 @@ - + diff --git a/addons/website_certification/views/website_certification_views.xml b/addons/website_certification/views/website_certification_views.xml index 2935c541a7b..cf2832b1775 100644 --- a/addons/website_certification/views/website_certification_views.xml +++ b/addons/website_certification/views/website_certification_views.xml @@ -38,7 +38,7 @@ - + diff --git a/addons/website_event_track/views/event_backend.xml b/addons/website_event_track/views/event_backend.xml index 3e77909d308..4db4fb967fe 100644 --- a/addons/website_event_track/views/event_backend.xml +++ b/addons/website_event_track/views/event_backend.xml @@ -281,7 +281,7 @@ - + diff --git a/addons/website_forum/views/forum.xml b/addons/website_forum/views/forum.xml index 233aeae40be..a98c35ede36 100644 --- a/addons/website_forum/views/forum.xml +++ b/addons/website_forum/views/forum.xml @@ -102,7 +102,7 @@ - + diff --git a/doc/03_module_dev_03.rst b/doc/03_module_dev_03.rst index da0e6da1090..e5e309fe00e 100644 --- a/doc/03_module_dev_03.rst +++ b/doc/03_module_dev_03.rst @@ -158,7 +158,7 @@ in a row (no automatic line wrapping), and only use the following attributes: .. code-block:: xml - + diff --git a/openerp/addons/base/ir/ir_attachment_view.xml b/openerp/addons/base/ir/ir_attachment_view.xml index 02ccfe73a25..f3d63069a25 100644 --- a/openerp/addons/base/ir/ir_attachment_view.xml +++ b/openerp/addons/base/ir/ir_attachment_view.xml @@ -72,7 +72,7 @@ help="Filter on my documents"/> - + diff --git a/openerp/addons/base/ir/ir_cron_view.xml b/openerp/addons/base/ir/ir_cron_view.xml index 63c8994b48b..d6d01336e08 100644 --- a/openerp/addons/base/ir/ir_cron_view.xml +++ b/openerp/addons/base/ir/ir_cron_view.xml @@ -70,7 +70,7 @@ - + diff --git a/openerp/addons/base/ir/ir_filters.xml b/openerp/addons/base/ir/ir_filters.xml index 88cc4b9838a..58ed0e9c219 100644 --- a/openerp/addons/base/ir/ir_filters.xml +++ b/openerp/addons/base/ir/ir_filters.xml @@ -51,7 +51,7 @@ - + diff --git a/openerp/addons/base/ir/ir_logging_view.xml b/openerp/addons/base/ir/ir_logging_view.xml index f963fc0d393..0ef3a857526 100644 --- a/openerp/addons/base/ir/ir_logging_view.xml +++ b/openerp/addons/base/ir/ir_logging_view.xml @@ -44,7 +44,7 @@ - + diff --git a/openerp/addons/base/ir/ir_model_view.xml b/openerp/addons/base/ir/ir_model_view.xml index fb68df9b5ff..ea5cf0f479f 100644 --- a/openerp/addons/base/ir/ir_model_view.xml +++ b/openerp/addons/base/ir/ir_model_view.xml @@ -221,7 +221,7 @@ - + @@ -283,7 +283,7 @@ - + @@ -416,7 +416,7 @@ - + diff --git a/openerp/addons/base/ir/ir_ui_view_view.xml b/openerp/addons/base/ir/ir_ui_view_view.xml index d3ac3058054..aef73e0948a 100644 --- a/openerp/addons/base/ir/ir_ui_view_view.xml +++ b/openerp/addons/base/ir/ir_ui_view_view.xml @@ -60,7 +60,7 @@ - + diff --git a/openerp/addons/base/ir/ir_values_view.xml b/openerp/addons/base/ir/ir_values_view.xml index b94c6870ab6..dab7b3a05f3 100644 --- a/openerp/addons/base/ir/ir_values_view.xml +++ b/openerp/addons/base/ir/ir_values_view.xml @@ -67,7 +67,7 @@ - + diff --git a/openerp/addons/base/module/module_view.xml b/openerp/addons/base/module/module_view.xml index 110b607fd4e..d68e67c82ec 100644 --- a/openerp/addons/base/module/module_view.xml +++ b/openerp/addons/base/module/module_view.xml @@ -43,7 +43,7 @@ - + diff --git a/openerp/addons/base/res/res_partner_view.xml b/openerp/addons/base/res/res_partner_view.xml index 50045aaf270..3be3b94c15d 100644 --- a/openerp/addons/base/res/res_partner_view.xml +++ b/openerp/addons/base/res/res_partner_view.xml @@ -343,7 +343,7 @@ - + diff --git a/openerp/addons/base/workflow/workflow_view.xml b/openerp/addons/base/workflow/workflow_view.xml index 5c262299917..ec4f1b500fb 100644 --- a/openerp/addons/base/workflow/workflow_view.xml +++ b/openerp/addons/base/workflow/workflow_view.xml @@ -165,7 +165,7 @@ - + From c4fc0f59926627f7148a9118c76bd0f268adabfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 22 May 2014 13:53:26 +0200 Subject: [PATCH 14/48] [IMP] work on scrollable zone in web client add a div parent to oe_view_manager_body, and move the searchview drawer inside oe_view_manager_body. This is in preparation to the goal of making the oe_view_manager_body div scrollable --- addons/web/static/src/js/views.js | 4 ++-- addons/web/static/src/xml/base.xml | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 4cbf036e9f3..cbabba4e1f2 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -647,7 +647,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ _.each(_.keys(self.views), function(view_name) { var controller = self.views[view_name].controller; if (controller) { - var container = self.$el.find("> .oe_view_manager_body > .oe_view_manager_view_" + view_name); + var container = self.$el.find("> .oe_view_manager_parent > .oe_view_manager_body > .oe_view_manager_view_" + view_name); if (view_name === view_type) { container.show(); controller.do_show(view_options || {}); @@ -690,7 +690,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ controller.on('switch_mode', self, this.switch_mode); controller.on('previous_view', self, this.prev_view); - var container = this.$el.find("> .oe_view_manager_body > .oe_view_manager_view_" + view_type); + var container = this.$el.find("> .oe_view_manager_parent > .oe_view_manager_body > .oe_view_manager_view_" + view_type); var view_promise = controller.appendTo(container); this.views[view_type].controller = controller; this.views[view_type].deferred.resolve(view_type); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index e9ade4d14a5..f0673543b6c 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -520,12 +520,13 @@ -
        - +
        - -
        - +
        + +
        + +
        From 8b132b70c55536a7c4342558230e742b94765424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 23 May 2014 15:07:09 +0200 Subject: [PATCH 15/48] [IMP] slightly improve the html structure of web client: remove an useless div .oe_view_manager_parent introduced by a clueless developper. --- addons/web/static/src/js/views.js | 4 ++-- addons/web/static/src/xml/base.xml | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index cbabba4e1f2..4cbf036e9f3 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -647,7 +647,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ _.each(_.keys(self.views), function(view_name) { var controller = self.views[view_name].controller; if (controller) { - var container = self.$el.find("> .oe_view_manager_parent > .oe_view_manager_body > .oe_view_manager_view_" + view_name); + var container = self.$el.find("> .oe_view_manager_body > .oe_view_manager_view_" + view_name); if (view_name === view_type) { container.show(); controller.do_show(view_options || {}); @@ -690,7 +690,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ controller.on('switch_mode', self, this.switch_mode); controller.on('previous_view', self, this.prev_view); - var container = this.$el.find("> .oe_view_manager_parent > .oe_view_manager_body > .oe_view_manager_view_" + view_type); + var container = this.$el.find("> .oe_view_manager_body > .oe_view_manager_view_" + view_type); var view_promise = controller.appendTo(container); this.views[view_type].controller = controller; this.views[view_type].deferred.resolve(view_type); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index f0673543b6c..593e04b2b61 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -520,13 +520,11 @@ -
        -
        -
        - -
        - -
        +
        +
        + +
        +
        From 088b33d0bcff1ccb641ebec8712bec13ff39af45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 23 May 2014 15:09:48 +0200 Subject: [PATCH 16/48] [IMP] change scrollable area to main view Now, only the main view is supposed to scroll (the part below the header with the view selector). The left menu, top bar and header are supposed to stay fixed. This is done by carefully using position:relative and absolute. However, this is likely to introduce some (many?) issues, perhaps with tooltips position and such. The bug hunt is on! --- addons/web/static/src/css/base.css | 12 +++++++++++- addons/web/static/src/css/base.sass | 10 +++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index f46a0de5836..25e5d861648 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1156,9 +1156,15 @@ display: table; height: inherit; width: 100%; + position: relative; } .openerp .oe_view_manager .oe_view_manager_body { - height: inherit; + position: absolute; + overflow: auto; + top: 90px; + bottom: 0; + left: 0; + right: 0; } .openerp .oe_view_manager .oe_view_manager_view_kanban:not(:empty) { height: inherit; @@ -3401,3 +3407,7 @@ input[type="radio"], input[type="checkbox"] { background-color: black; opacity: 0.6; } + +body { + overflow: hidden; +} diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 18da5a7098c..f2815adbf72 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -970,8 +970,14 @@ $sheet-padding: 16px display: table height: inherit width: 100% + position: relative .oe_view_manager_body - height: inherit + position: absolute + overflow: auto + top: 90px + bottom: 0 + left: 0 + right: 0 .oe_view_manager_view_kanban:not(:empty) height: inherit &[data-view-type=kanban] @@ -2762,5 +2768,7 @@ input[type="radio"], input[type="checkbox"] opacity: 0.6000000238418579 +body + overflow: hidden // au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers > "%:p:r.css" // vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker: From 3c468073d481d203856c4fad575eee49f2317c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 23 May 2014 15:51:57 +0200 Subject: [PATCH 17/48] [IMP] small css tweaks correct a few problems introduced by the change to the scrolling area. Note: body is in overflow:auto to allow scrolling when there is no view manager (for example, client action) --- addons/web/static/src/css/base.css | 6 +++--- addons/web/static/src/css/base.sass | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 25e5d861648..c9e70201b97 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1135,6 +1135,7 @@ .openerp .oe_application { width: 100%; height: 100%; + position: relative; } .openerp .oe_application a { color: #7c7bad; @@ -1156,7 +1157,6 @@ display: table; height: inherit; width: 100%; - position: relative; } .openerp .oe_view_manager .oe_view_manager_body { position: absolute; @@ -1167,7 +1167,7 @@ right: 0; } .openerp .oe_view_manager .oe_view_manager_view_kanban:not(:empty) { - height: inherit; + height: 100%; } .openerp .oe_view_manager[data-view-type=kanban] .oe_view_manager_body { display: table-row; @@ -3409,5 +3409,5 @@ input[type="radio"], input[type="checkbox"] { } body { - overflow: hidden; + overflow: auto; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index f2815adbf72..72c71070e41 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -952,6 +952,7 @@ $sheet-padding: 16px .oe_application width: 100% height: 100% + position: relative a color: $link-color > div @@ -970,7 +971,6 @@ $sheet-padding: 16px display: table height: inherit width: 100% - position: relative .oe_view_manager_body position: absolute overflow: auto @@ -979,7 +979,7 @@ $sheet-padding: 16px left: 0 right: 0 .oe_view_manager_view_kanban:not(:empty) - height: inherit + height: 100% &[data-view-type=kanban] .oe_view_manager_body display: table-row @@ -2769,6 +2769,6 @@ input[type="radio"], input[type="checkbox"] body - overflow: hidden + overflow: auto // au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers > "%:p:r.css" // vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker: From b374cf0089afa95228e66e614b5c15a78d559c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 23 May 2014 16:07:42 +0200 Subject: [PATCH 18/48] [IMP] fix a css problem with multiple view_manager when a view_manager is contained inside another, the css rule for defining a scrollable zone (with position:absolute) was also applied to the inside view manager. --- addons/web/static/src/css/base.css | 16 ++++++++-------- addons/web/static/src/css/base.sass | 16 +++++++++------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index c9e70201b97..8f8db21a2a7 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1143,6 +1143,14 @@ .openerp .oe_application > div { height: 100%; } +.openerp .oe_application > div > .oe_view_manager > .oe_view_manager_body { + position: absolute; + overflow: auto; + top: 90px; + bottom: 0; + left: 0; + right: 0; +} .openerp .oe_application .oe_breadcrumb_item:not(:last-child) { max-width: 7em; white-space: nowrap; @@ -1158,14 +1166,6 @@ height: inherit; width: 100%; } -.openerp .oe_view_manager .oe_view_manager_body { - position: absolute; - overflow: auto; - top: 90px; - bottom: 0; - left: 0; - right: 0; -} .openerp .oe_view_manager .oe_view_manager_view_kanban:not(:empty) { height: 100%; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 72c71070e41..d70b03006f0 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -957,6 +957,15 @@ $sheet-padding: 16px color: $link-color > div height: 100% + > .oe_view_manager + > .oe_view_manager_body + position: absolute + overflow: auto + top: 90px + bottom: 0 + left: 0 + right: 0 + .oe_breadcrumb_item:not(:last-child) max-width: 7em white-space: nowrap @@ -971,13 +980,6 @@ $sheet-padding: 16px display: table height: inherit width: 100% - .oe_view_manager_body - position: absolute - overflow: auto - top: 90px - bottom: 0 - left: 0 - right: 0 .oe_view_manager_view_kanban:not(:empty) height: 100% &[data-view-type=kanban] From 779aabfc5b2908b8f2fd42a7c15f866c403cdc61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 23 May 2014 17:06:50 +0200 Subject: [PATCH 19/48] [FIX] various css fixes related to scrolling (1) it seems that position:relative behaviour is undefined in a td, so it has been moved to the div below oe_application (2) the left menu bar can now scroll vertically if necessary. --- addons/web/static/src/css/base.css | 6 +++++- addons/web/static/src/css/base.sass | 5 ++++- addons/web/static/src/xml/base.xml | 18 ++++++++++-------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 8f8db21a2a7..5a95ee15a32 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -996,6 +996,10 @@ text-shadow: none; padding-bottom: 16px; } +.openerp .oe_leftbar > div { + max-height: 100%; + overflow-y: auto; +} .openerp a.oe_logo { position: relative; width: 220px; @@ -1135,12 +1139,12 @@ .openerp .oe_application { width: 100%; height: 100%; - position: relative; } .openerp .oe_application a { color: #7c7bad; } .openerp .oe_application > div { + position: relative; height: 100%; } .openerp .oe_application > div > .oe_view_manager > .oe_view_manager_body { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index d70b03006f0..df5689c4574 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -845,6 +845,9 @@ $sheet-padding: 16px border-right: 1px solid $tag-border text-shadow: none padding-bottom: 16px + > div + max-height: 100% + overflow-y: auto a.oe_logo position: relative width: 220px @@ -952,10 +955,10 @@ $sheet-padding: 16px .oe_application width: 100% height: 100% - position: relative a color: $link-color > div + position: relative height: 100% > .oe_view_manager > .oe_view_manager_body diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 593e04b2b61..5aad3487403 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -440,14 +440,16 @@ - - -
        -