From 344beaf2826e0d09c2d19923f53657b46979a110 Mon Sep 17 00:00:00 2001 From: "Florimond Husquinet (fhu)" Date: Wed, 28 Aug 2019 08:14:50 +0000 Subject: [PATCH 1/8] [CLA] Signature for hari4274 Ticket: 2058955 closes odoo/odoo#36162 Signed-off-by: Martin Trigaux (mat) --- doc/cla/individual/hari4274.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/hari4274.md diff --git a/doc/cla/individual/hari4274.md b/doc/cla/individual/hari4274.md new file mode 100644 index 00000000000..24ff61a8cd6 --- /dev/null +++ b/doc/cla/individual/hari4274.md @@ -0,0 +1,11 @@ +India, 2019-08-24 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Hariprasath bala.hariprasath@gmail.com https://github.com/hari4274 \ No newline at end of file From 3862f6366908c07b6ffe06d8693c2a82c7d74f58 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 28 Aug 2019 08:54:30 +0000 Subject: [PATCH 2/8] [FIX] theme_bootswatch, doc: https import for less3 The @import directive in less leave the @import as is if it detects .css extension. Otherwise it will use the less import. Since less 3.0.0 less/less.js@77fde7eb7 checking css extension regex changed from: /[#\.\&\?\/]css([\?;].*)?$/ to: /[#\.\&\?]css([\?;].*)?$/ thus all our import of google fonts with URI like: //fonts.googleapis.com/css?family=FontName now are getting imported as less, thus they are included directly in the output file with HTTP scheme URL which may be blocked on HTTPS instance. With this fix, we specify that the import is a normal CSS one with (css) import option: http://lesscss.org/features/#import-atrules-feature-css opw-2057037 closes #36167 Signed-off-by: Nicolas Lempereur (nle) --- .../theme_bootswatch/static/src/less/amelia/bootswatch.less | 2 +- addons/theme_bootswatch/static/src/less/cosmo/bootswatch.less | 2 +- .../theme_bootswatch/static/src/less/cyborg/bootswatch.less | 4 ++-- .../theme_bootswatch/static/src/less/flatly/bootswatch.less | 2 +- .../theme_bootswatch/static/src/less/journal/bootswatch.less | 2 +- .../theme_bootswatch/static/src/less/readable/bootswatch.less | 2 +- .../theme_bootswatch/static/src/less/simplex/bootswatch.less | 4 ++-- .../theme_bootswatch/static/src/less/spacelab/bootswatch.less | 4 ++-- .../theme_bootswatch/static/src/less/united/bootswatch.less | 4 ++-- doc/_extensions/odoo_ext/static/variables.less | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/theme_bootswatch/static/src/less/amelia/bootswatch.less b/addons/theme_bootswatch/static/src/less/amelia/bootswatch.less index d581785e9fd..740c7c138d3 100644 --- a/addons/theme_bootswatch/static/src/less/amelia/bootswatch.less +++ b/addons/theme_bootswatch/static/src/less/amelia/bootswatch.less @@ -2,7 +2,7 @@ // Bootswatch // ----------------------------------------------------- -@import url("//fonts.googleapis.com/css?family=Lobster|Cabin:400,700"); +@import (css) url("//fonts.googleapis.com/css?family=Lobster|Cabin:400,700"); // Navbar ===================================================================== diff --git a/addons/theme_bootswatch/static/src/less/cosmo/bootswatch.less b/addons/theme_bootswatch/static/src/less/cosmo/bootswatch.less index 0be302254db..2da2fa2218a 100644 --- a/addons/theme_bootswatch/static/src/less/cosmo/bootswatch.less +++ b/addons/theme_bootswatch/static/src/less/cosmo/bootswatch.less @@ -2,7 +2,7 @@ // Bootswatch // ----------------------------------------------------- -@import url("//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700"); +@import (css) url("//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700"); // Navbar ===================================================================== diff --git a/addons/theme_bootswatch/static/src/less/cyborg/bootswatch.less b/addons/theme_bootswatch/static/src/less/cyborg/bootswatch.less index eb5f6dff002..ee353fb753e 100644 --- a/addons/theme_bootswatch/static/src/less/cyborg/bootswatch.less +++ b/addons/theme_bootswatch/static/src/less/cyborg/bootswatch.less @@ -2,7 +2,7 @@ // Bootswatch // ----------------------------------------------------- -@import url("//fonts.googleapis.com/css?family=Roboto:400,700"); +@import (css) url("//fonts.googleapis.com/css?family=Roboto:400,700"); // Navbar ===================================================================== @@ -161,4 +161,4 @@ a.thumbnail.active { h1, h2, h3, h4, h5, h6 { color: #fff; } -} \ No newline at end of file +} diff --git a/addons/theme_bootswatch/static/src/less/flatly/bootswatch.less b/addons/theme_bootswatch/static/src/less/flatly/bootswatch.less index a4d8f311836..2b53000bc5f 100644 --- a/addons/theme_bootswatch/static/src/less/flatly/bootswatch.less +++ b/addons/theme_bootswatch/static/src/less/flatly/bootswatch.less @@ -2,7 +2,7 @@ // Bootswatch // ----------------------------------------------------- -@import url("//fonts.googleapis.com/css?family=Lato:400,700,400italic"); +@import (css) url("//fonts.googleapis.com/css?family=Lato:400,700,400italic"); // Navbar ===================================================================== diff --git a/addons/theme_bootswatch/static/src/less/journal/bootswatch.less b/addons/theme_bootswatch/static/src/less/journal/bootswatch.less index 151f5af7650..167c6863f2b 100644 --- a/addons/theme_bootswatch/static/src/less/journal/bootswatch.less +++ b/addons/theme_bootswatch/static/src/less/journal/bootswatch.less @@ -2,7 +2,7 @@ // Bootswatch // ----------------------------------------------------- -@import url("//fonts.googleapis.com/css?family=News+Cycle:400,700"); +@import (css) url("//fonts.googleapis.com/css?family=News+Cycle:400,700"); // Navbar ===================================================================== diff --git a/addons/theme_bootswatch/static/src/less/readable/bootswatch.less b/addons/theme_bootswatch/static/src/less/readable/bootswatch.less index 621582acb3a..c7d7cd4cc66 100644 --- a/addons/theme_bootswatch/static/src/less/readable/bootswatch.less +++ b/addons/theme_bootswatch/static/src/less/readable/bootswatch.less @@ -2,7 +2,7 @@ // Bootswatch // ----------------------------------------------------- -@import url("//fonts.googleapis.com/css?family=Raleway:400,700"); +@import (css) url("//fonts.googleapis.com/css?family=Raleway:400,700"); // Navbar ===================================================================== diff --git a/addons/theme_bootswatch/static/src/less/simplex/bootswatch.less b/addons/theme_bootswatch/static/src/less/simplex/bootswatch.less index 9587dd0ec88..137501ff46c 100644 --- a/addons/theme_bootswatch/static/src/less/simplex/bootswatch.less +++ b/addons/theme_bootswatch/static/src/less/simplex/bootswatch.less @@ -2,7 +2,7 @@ // Bootswatch // ----------------------------------------------------- -@import url("//fonts.googleapis.com/css?family=Open+Sans:400,700"); +@import (css) url("//fonts.googleapis.com/css?family=Open+Sans:400,700"); .btn-shadow(@color) { #gradient > .vertical-three-colors(lighten(@color, 3%), @color, 6%, darken(@color, 3%)); @@ -139,4 +139,4 @@ label { // Progress bars ============================================================== -// Containers ================================================================= \ No newline at end of file +// Containers ================================================================= diff --git a/addons/theme_bootswatch/static/src/less/spacelab/bootswatch.less b/addons/theme_bootswatch/static/src/less/spacelab/bootswatch.less index 16a6678dc59..30f87c110ed 100644 --- a/addons/theme_bootswatch/static/src/less/spacelab/bootswatch.less +++ b/addons/theme_bootswatch/static/src/less/spacelab/bootswatch.less @@ -2,7 +2,7 @@ // Bootswatch // ----------------------------------------------------- -@import url("//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700"); +@import (css) url("//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700"); .btn-shadow(@color) { #gradient > .vertical-three-colors(lighten(@color, 15%), @color, 50%, darken(@color, 4%)); @@ -136,4 +136,4 @@ color: #fff; } } -} \ No newline at end of file +} diff --git a/addons/theme_bootswatch/static/src/less/united/bootswatch.less b/addons/theme_bootswatch/static/src/less/united/bootswatch.less index dbe7aba6dfe..0446b9a9b82 100644 --- a/addons/theme_bootswatch/static/src/less/united/bootswatch.less +++ b/addons/theme_bootswatch/static/src/less/united/bootswatch.less @@ -2,7 +2,7 @@ // Bootswatch // ----------------------------------------------------- -@import url("//fonts.googleapis.com/css?family=Ubuntu"); +@import (css) url("//fonts.googleapis.com/css?family=Ubuntu"); // Navbar ===================================================================== @@ -39,4 +39,4 @@ // Progress bars ============================================================== -// Containers ================================================================= \ No newline at end of file +// Containers ================================================================= diff --git a/doc/_extensions/odoo_ext/static/variables.less b/doc/_extensions/odoo_ext/static/variables.less index 27399411813..8031d3568be 100644 --- a/doc/_extensions/odoo_ext/static/variables.less +++ b/doc/_extensions/odoo_ext/static/variables.less @@ -79,7 +79,7 @@ // =============================================== //== Fonts -@import url(https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,600,700&subset=latin,latin-ext); +@import (css) url(https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,600,700&subset=latin,latin-ext); //== Font sizes/weigths @font-size-base : 15px; From 7c99310b2337468db1b19e682fc0b9555d3a8731 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 9 Jul 2019 11:31:25 +0000 Subject: [PATCH 3/8] [FIX] auth_oauth: Override qcontext in the right place Before this patch, if some module was based on top of `auth_signup`, and `auth_oauth` was also installed in the same database, the only way to get the proper qcontext would be to call `super()` inside `web_auth_signup_qcontext`, which would produce a login, which is most likely not desired because such addon would try to add some logic on top of it that maybe prevents login based on some circumstances. After this patch, any submodules can work properly without workarounds. closes odoo/odoo#34690 Signed-off-by: Christophe Simonis --- addons/auth_oauth/controllers/main.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py index 0e8270d7eed..255da750f4b 100644 --- a/addons/auth_oauth/controllers/main.py +++ b/addons/auth_oauth/controllers/main.py @@ -109,19 +109,10 @@ class OAuthLogin(Home): return response - @http.route() - def web_auth_signup(self, *args, **kw): - providers = self.list_providers() - response = super(OAuthLogin, self).web_auth_signup(*args, **kw) - response.qcontext.update(providers=providers) - return response - - @http.route() - def web_auth_reset_password(self, *args, **kw): - providers = self.list_providers() - response = super(OAuthLogin, self).web_auth_reset_password(*args, **kw) - response.qcontext.update(providers=providers) - return response + def get_auth_signup_qcontext(self): + result = super(OAuthLogin, self).get_auth_signup_qcontext() + result["providers"] = self.list_providers() + return result class OAuthController(http.Controller): From 01f66151c0c9acc27dbcafa00fcdcd4546f1106e Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Mon, 20 May 2019 06:21:05 +0000 Subject: [PATCH 4/8] [IMP] web: remove m2o from supportedTypes in selection widget currently widget selection is not working in m2o in editable list view and to fix this issue it need a lots of changes to make it work properly, i.e. make '_fetchSpecialRelation' use correct domain for each record, batch requests as much as possible, also make all '_fetchSpecial...' work in the list case. So to avoid major changes remove supportedTypes from selection widget so user can not tempted to apply selection widget on many2one field. task-1871698 closes odoo/odoo#33485 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/js/fields/relational_fields.js | 2 +- doc/reference/javascript_reference.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 581b5f2a62c..63eb1d660db 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -2043,7 +2043,7 @@ var FieldStatus = AbstractField.extend({ var FieldSelection = AbstractField.extend({ template: 'FieldSelection', specialData: "_fetchSpecialRelation", - supportedFieldTypes: ['selection', 'many2one'], + supportedFieldTypes: ['selection'], events: _.extend({}, AbstractField.prototype.events, { 'change': '_onChange', }), diff --git a/doc/reference/javascript_reference.rst b/doc/reference/javascript_reference.rst index d7fb8de399a..b3acee7b87b 100644 --- a/doc/reference/javascript_reference.rst +++ b/doc/reference/javascript_reference.rst @@ -1666,7 +1666,7 @@ Relational fields .. autoclass:: web.relational_fields.FieldSelection - Supported field types: *selection*, *many2one* + Supported field types: *selection* .. attribute:: placeholder @@ -1697,7 +1697,7 @@ Relational fields - many2one (FieldMany2One) Default widget for many2one fields. - - Supported field types: *selection, many2one* + - Supported field types: *many2one* Attributes: From 4109053388da776cf693cc3b4b5dce1fd6508bb6 Mon Sep 17 00:00:00 2001 From: Luis Date: Thu, 7 Mar 2019 16:23:21 +0000 Subject: [PATCH 5/8] [FIX] base: add js_class to calendar rnd Fix missing js_class attribute on the calendar xml validation file Make possible to create new custom views based on the calendar view Was already done in master at 496920a8f5691b7 but was not present in 11.0 Closes odoo/odoo#26750 Closes odoo/odoo#31679 Closes odoo/odoo#36156 Signed-off-by: Martin Trigaux (mat) --- odoo/addons/base/rng/calendar_view.rng | 1 + 1 file changed, 1 insertion(+) diff --git a/odoo/addons/base/rng/calendar_view.rng b/odoo/addons/base/rng/calendar_view.rng index 500a61b3389..656445e449e 100644 --- a/odoo/addons/base/rng/calendar_view.rng +++ b/odoo/addons/base/rng/calendar_view.rng @@ -19,6 +19,7 @@ + From 55feae243656bab16cb79b30255d3fc299f3e8dd Mon Sep 17 00:00:00 2001 From: Julien Mougenot Date: Mon, 26 Aug 2019 13:53:11 +0000 Subject: [PATCH 6/8] [FIX] web: searchbar: focus first item Doesn't focus hovered option in the searchbar Before this commit: When typing in the searchbar while having the cursor right under it, the selected option was automatically the one hovered by the cursor. Now, the default option is the first one (typically name search) and the cursor hovering only takes effect when moved for the first time. Task 2058656 closes odoo/odoo#36099 Signed-off-by: VincentSchippefilt --- addons/web/static/src/js/widgets/auto_complete.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/widgets/auto_complete.js b/addons/web/static/src/js/widgets/auto_complete.js index 883206ae4c2..081322f7b1d 100644 --- a/addons/web/static/src/js/widgets/auto_complete.js +++ b/addons/web/static/src/js/widgets/auto_complete.js @@ -127,12 +127,22 @@ return Widget.extend({ var $item = self.make_list_item(result).appendTo($list); result.$el = $item; }); + // IE9 doesn't support addEventListener with option { once: true } + this.el.onmousemove = function (ev) { + self.$('li').each(function (index, li) { + li.onmouseenter = self.focus_element.bind(self, $(li)); + }); + var targetFocus = ev.target.tagName === 'LI' ? + ev.target : + ev.target.closest('li'); + self.focus_element($(targetFocus)); + self.el.onmousemove = null; + }; this.show(); }, make_list_item: function (result) { var self = this; var $li = $('
  • ') - .hover(function () {self.focus_element($li);}) .mousedown(function (ev) { if (ev.button === 0) { // left button self.select(ev, {item: {facet: result.facet}}); From 4855b52c550fd305a226dc66eea8466ae34a0f4e Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Thu, 22 Aug 2019 09:58:23 +0000 Subject: [PATCH 7/8] [FIX] web: graph: id not in groupby Before this commit, when having the field "id" in the graph view it was selected to group by on it. This doesn't really make sense, and triggers an sql error anyway After this commit, we filter out that field from the groupbys OPW 2053444 closes odoo/odoo#35958 Signed-off-by: Lucas Perais (lpe) --- .../static/src/js/views/graph/graph_view.js | 3 +++ addons/web/static/tests/views/graph_tests.js | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/addons/web/static/src/js/views/graph/graph_view.js b/addons/web/static/src/js/views/graph/graph_view.js index a5ad21e1816..e850b629710 100644 --- a/addons/web/static/src/js/views/graph/graph_view.js +++ b/addons/web/static/src/js/views/graph/graph_view.js @@ -43,6 +43,9 @@ var GraphView = AbstractView.extend({ viewInfo.fields = _.defaults({__count__: {string: _t("Count"), type: "integer"}}, viewInfo.fields); viewInfo.arch.children.forEach(function (field) { var name = field.attrs.name; + if (name === "id") { + return; + } if (field.attrs.interval) { name += ':' + field.attrs.interval; } diff --git a/addons/web/static/tests/views/graph_tests.js b/addons/web/static/tests/views/graph_tests.js index 1e5edef4df3..da9384f72e8 100644 --- a/addons/web/static/tests/views/graph_tests.js +++ b/addons/web/static/tests/views/graph_tests.js @@ -105,6 +105,27 @@ QUnit.module('Views', { graph.destroy(); }); + QUnit.test('field id not in groupBy', function (assert) { + assert.expect(1); + + var graph = createView({ + View: GraphView, + model: "foo", + data: this.data, + arch: '' + + '' + + '', + mockRPC: function (route, args) { + if (args.method === 'read_group') { + assert.deepEqual(args.kwargs.groupby, [], + 'groupby should not contain id field'); + } + return this._super.apply(this, arguments); + } + }); + graph.destroy(); + }); + QUnit.test('switching mode', function (assert) { assert.expect(6); From 55d1c66c8efdd432603e777fe3fe4e74a6e9275d Mon Sep 17 00:00:00 2001 From: "Florimond Husquinet (fhu)" Date: Wed, 28 Aug 2019 14:08:01 +0000 Subject: [PATCH 8/8] [FIX] mail: parse message with invalid html as content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, when a message contains invalid HTML, it crashed with error such as: "TypeError: Cannot read property 'childNodes' of null". This commit fixes the issue by wrapping the content of messages with invalid HTML in a `
    ` tag.
    
    OPW-2048140
    
    closes odoo/odoo#36196
    
    Signed-off-by: Alexandre Kühn (aku) 
    ---
     addons/mail/static/src/js/utils.js | 7 ++++++-
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/addons/mail/static/src/js/utils.js b/addons/mail/static/src/js/utils.js
    index 347b104e76c..75d28b0ae10 100644
    --- a/addons/mail/static/src/js/utils.js
    +++ b/addons/mail/static/src/js/utils.js
    @@ -46,7 +46,12 @@ var _beep = (function () {
     function parse_and_transform(html_string, transform_function) {
         var open_token = "OPEN" + Date.now();
         var string = html_string.replace(/</g, open_token);
    -    var children = $('
    ').html(string).contents(); + var children; + try { + children = $('
    ').html(string).contents(); + } catch (e) { + children = $('
    ').html('
    ' + string + '
    ').contents(); + } return _parse_and_transform(children, transform_function) .replace(new RegExp(open_token, "g"), "<"); }