From 344beaf2826e0d09c2d19923f53657b46979a110 Mon Sep 17 00:00:00 2001 From: "Florimond Husquinet (fhu)" Date: Wed, 28 Aug 2019 08:14:50 +0000 Subject: [PATCH 01/21] [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 02/21] [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 03/21] [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 f2b7427fb4c02b8e9fbb1271fc88efbf5fb2ef40 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 22 Aug 2019 07:26:42 +0000 Subject: [PATCH 04/21] [FIX] website_event_track: suggest recipient with an email If an event track had a speaker assigned who had an email, and the email field in the track itself was empty, Odoo was suggesting the user to send an email to an empty recipient, making an error Now it only suggests the email if there's one. Fixes odoo/odoo#35941 Signed-off-by: Martin Trigaux (mat) --- addons/website_event_track/models/event_track.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_event_track/models/event_track.py b/addons/website_event_track/models/event_track.py index cd581946580..a58235d61c4 100644 --- a/addons/website_event_track/models/event_track.py +++ b/addons/website_event_track/models/event_track.py @@ -155,7 +155,7 @@ class Track(models.Model): def message_get_suggested_recipients(self): recipients = super(Track, self).message_get_suggested_recipients() for track in self: - if track.partner_email != track.partner_id.email: + if track.partner_email and track.partner_email != track.partner_id.email: track._message_add_suggested_recipient(recipients, email=track.partner_email, reason=_('Speaker Email')) return recipients From 61eccf212b25e03564c1e51bea3723873a862042 Mon Sep 17 00:00:00 2001 From: Wolfgang Taferner Date: Thu, 22 Aug 2019 04:09:41 +0000 Subject: [PATCH 05/21] [FIX] payment_stripe: backwards compatibility IE 11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes odoo/odoo#35944 Signed-off-by: Jérémy Kersten (jke) --- addons/payment_stripe/static/src/js/stripe.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/payment_stripe/static/src/js/stripe.js b/addons/payment_stripe/static/src/js/stripe.js index 8de9bc62c4a..d1db0cee113 100644 --- a/addons/payment_stripe/static/src/js/stripe.js +++ b/addons/payment_stripe/static/src/js/stripe.js @@ -130,14 +130,14 @@ odoo.define('payment_stripe.stripe', function(require) { }).then(function (data) { try { provider_form[0].innerHTML = data; } catch (e) {}; }); - } else if (window.location.href.includes("/my/orders/")) { + } else if (window.location.href.indexOf("/my/orders/") !== -1) { var create_tx = ajax.jsonRpc('/pay/sale/' + so_id + '/form_tx/', 'call', { access_token: access_token, acquirer_id: acquirer_id }).then(function (data) { try { provider_form.innerHTML = data; } catch (e) {}; }); - } else if (window.location.href.includes("/my/invoices/")) { + } else if (window.location.href.indexOf("/my/invoices/") !== -1) { var create_tx = ajax.jsonRpc('/invoice/pay/' + invoice_id + '/form_tx/', 'call', { access_token: access_token, acquirer_id: acquirer_id From 06a516af408e499e53c94ab90ed16001b1af815f Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 20 Aug 2019 14:35:17 +0000 Subject: [PATCH 06/21] [FIX] gamification, hr_recruitment, maintenance: kankan tooltip no longer supports field tag In v10.0, it was possible, and kinda work, to have ```
  • Project:
``` In v11.0 onwards, this "feature" has been dropped, since in kanban records it doesn't make much sense to a field defined/displayed that way The right way is to call `record.(field).(raw_)?value` This commit adapts the only two modules still having kanban-tooltip classes in their views OPW 2055132 related to #29802 closes odoo/odoo#35869 Signed-off-by: Aaron Bohy (aab) --- addons/gamification/views/goal.xml | 5 ++++- addons/hr_recruitment/views/hr_recruitment_views.xml | 7 ++++--- addons/maintenance/views/maintenance_views.xml | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/addons/gamification/views/goal.xml b/addons/gamification/views/goal.xml index dda5f0c35ff..9a539077469 100644 --- a/addons/gamification/views/goal.xml +++ b/addons/gamification/views/goal.xml @@ -136,6 +136,7 @@ + @@ -144,7 +145,9 @@ - +
    +
  • +
diff --git a/addons/hr_recruitment/views/hr_recruitment_views.xml b/addons/hr_recruitment/views/hr_recruitment_views.xml index a289939bc33..aaae0365d60 100644 --- a/addons/hr_recruitment/views/hr_recruitment_views.xml +++ b/addons/hr_recruitment/views/hr_recruitment_views.xml @@ -253,6 +253,7 @@ + @@ -263,9 +264,9 @@
    -
  • Degree:
  • -
  • Contact:
  • -
  • Departement:
  • +
  • Degree:
  • +
  • Contact:
  • +
  • Departement:
diff --git a/addons/maintenance/views/maintenance_views.xml b/addons/maintenance/views/maintenance_views.xml index cdd3bd4f185..ed24538fe91 100644 --- a/addons/maintenance/views/maintenance_views.xml +++ b/addons/maintenance/views/maintenance_views.xml @@ -125,8 +125,8 @@
    -
  • Category:
  • -
  • Request to:
  • +
  • Category:
  • +
  • Request to:
@@ -396,8 +396,8 @@
    -
  • Serial Number:
  • -
  • Model Number:
  • +
  • Serial Number:
  • +
  • Model Number:
From 8443a74cd6e4c8aae67668da5ee52c6f9c1661bc Mon Sep 17 00:00:00 2001 From: mreficent Date: Wed, 21 Aug 2019 21:35:57 +0000 Subject: [PATCH 07/21] [FIX] account: computes correctly belongs_to_company Typo of https://github.com/odoo/odoo/commit/b154e219f68cc378ba8cc9dedf1d48819cd8e87a closes odoo/odoo#35937 Signed-off-by: Martin Trigaux (mat) --- addons/account/models/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account.py b/addons/account/models/account.py index f8f1303277c..1e739007490 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -534,7 +534,7 @@ class AccountJournal(models.Model): @api.depends('company_id') def _belong_to_company(self): for journal in self: - journal.belong_to_company = (journal.company_id.id == self.env.user.company_id.id) + journal.belongs_to_company = (journal.company_id.id == self.env.user.company_id.id) @api.multi def _search_company_journals(self, operator, value): From 01f66151c0c9acc27dbcafa00fcdcd4546f1106e Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Mon, 20 May 2019 06:21:05 +0000 Subject: [PATCH 08/21] [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 09/21] [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 10/21] [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 11/21] [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 da474d0e872c9938b061e133011bd36b416eafc7 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 22 Aug 2019 10:19:05 +0000 Subject: [PATCH 12/21] [FIX] web_editor: parallax effect in sanitized field A sanitize fields by default remove all attributes outside of a whitelist (if sanitize_attributes on field is not set to false). This prevent to use parallax widget in Html sanitized field since attribute "data-scroll-background-ratio" define parallax effect speed but was not in whitelist. note: also keep data-interval for gallery widget opw-2053983 closes #35961 Signed-off-by: Nicolas Lempereur (nle) --- odoo/tools/mail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/tools/mail.py b/odoo/tools/mail.py index 65ba6b32be1..74ad5154224 100644 --- a/odoo/tools/mail.py +++ b/odoo/tools/mail.py @@ -33,7 +33,7 @@ safe_attrs = clean.defs.safe_attrs | frozenset( ['style', 'data-o-mail-quote', # quote detection 'data-oe-model', 'data-oe-id', 'data-oe-field', 'data-oe-type', 'data-oe-expression', 'data-oe-translation-id', 'data-oe-nodeid', - 'data-publish', 'data-id', 'data-res_id', 'data-member_id', 'data-view-id' + 'data-publish', 'data-id', 'data-res_id', 'data-interval', 'data-member_id', 'data-scroll-background-ratio', 'data-view-id', ]) From e0c7a368580dfeac9af8dc3cb3a10fc33bf4b521 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 22 Aug 2019 12:14:18 +0000 Subject: [PATCH 13/21] [FIX] account_check_printing: set the amount in words - Create a vendor payment by check - Remove the amount in words - Confirm It is impossible to set the amount to print the check. We add an action button to recompute the amount in words. It is only visible when the amount is not set. opw-2046339 closes odoo/odoo#35968 Signed-off-by: Nicolas Martinelli (nim) --- addons/account_check_printing/models/account_payment.py | 4 ++++ addons/account_check_printing/views/account_payment_views.xml | 1 + 2 files changed, 5 insertions(+) diff --git a/addons/account_check_printing/models/account_payment.py b/addons/account_check_printing/models/account_payment.py index 37f3f1b9d53..b7d1189e4af 100644 --- a/addons/account_check_printing/models/account_payment.py +++ b/addons/account_check_printing/models/account_payment.py @@ -119,3 +119,7 @@ class AccountPayment(models.Model): """ This method is a hook for l10n_xx_check_printing modules to implement actual check printing capabilities """ raise UserError(_("There is no check layout configured.\nMake sure the proper check printing module is installed" " and its configuration (in company settings > 'Configuration' tab) is correct.")) + + def set_check_amount_in_words(self): + for payment in self: + payment.check_amount_in_words = payment.currency_id.amount_to_text(payment.amount) if payment.currency_id else '' diff --git a/addons/account_check_printing/views/account_payment_views.xml b/addons/account_check_printing/views/account_payment_views.xml index f3836a44099..c592f8a1675 100644 --- a/addons/account_check_printing/views/account_payment_views.xml +++ b/addons/account_check_printing/views/account_payment_views.xml @@ -8,6 +8,7 @@
  • - + +
    From 832dc676783e0cbaa2e9a1f491dfdd6ee4dd9bd6 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Fri, 9 Aug 2019 12:04:28 +0000 Subject: [PATCH 16/21] [FIX] point_of_sale: automatic selection of customer pricelist when using barcode Backport from 12.0 to 11.0 When using barcode to change the customer to a customer with a different pricelist than the pos default, the customer pricelist was not automatically selected. This is a fine-tuning on 5603b778f6a52a0c251be8d871139efdeeff5a40 opw-2047070 closes odoo/odoo#36050 Signed-off-by: Lucas Perais (lpe) --- addons/point_of_sale/static/src/js/screens.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index a2b34025c08..96a9cf67c2f 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -102,7 +102,10 @@ var ScreenWidget = PosBaseWidget.extend({ barcode_client_action: function(code){ var partner = this.pos.db.get_partner_by_barcode(code.code); if(partner){ - this.pos.get_order().set_client(partner); + if (this.pos.get_order().get_client() !== partner) { + this.pos.get_order().set_client(partner); + this.pos.get_order().set_pricelist(_.findWhere(this.pos.pricelists, {'id': partner.property_product_pricelist[0]}) || this.pos.default_pricelist); + } return true; } this.barcode_error_action(code); From 0ff1933ba122206db3003552b74f3a532cd68c3c Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Mon, 26 Aug 2019 14:35:17 +0000 Subject: [PATCH 17/21] [FIX] website: restore sitemap lastmod and priority MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 54d30d5194 introduced `lastmod` and `priority` on sitemap locs. This was broken with 4ecbacaf5957 which introduced `website.page` model as it removed the `PageConverter`. Before website.page: 1. PageConverter returned records with `__lastmod` 2. `enumerate_pages` loop on converters would remove the prefixed `__` After website.page: 1. code to remove `__` was still there but the pages would be found and looped on after that code, making it useless. With this commit: 1. The code to remove the `__` is moved after searching the pages. Following #36090 Related to #35464 Signed-off-by: Jérémy Kersten (jke) --- addons/website/models/website.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/addons/website/models/website.py b/addons/website/models/website.py index 2d267a489dc..cbaf967fb42 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -517,9 +517,6 @@ class Website(models.Model): domain_part, url = rule.build(value, append_unknown=False) if not query_string or query_string.lower() in url.lower(): page = {'loc': url} - for key, val in value.items(): - if key.startswith('__'): - page[key[2:]] = val if url in ('/sitemap.xml',): continue if url in url_set: @@ -543,9 +540,9 @@ class Website(models.Model): for page in pages: record = {'loc': page['url'], 'id': page['id'], 'name': page['name']} if page.view_id and page.view_id.priority != 16: - record['__priority'] = min(round(page.view_id.priority / 32.0, 1), 1) + record['priority'] = min(round(page.view_id.priority / 32.0, 1), 1) if page['write_date']: - record['__lastmod'] = page['write_date'][:10] + record['lastmod'] = page['write_date'][:10] yield record @api.multi From a20b84d05a3f76040a4ca9477b7719537e9c987d Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 26 Aug 2019 13:41:21 +0000 Subject: [PATCH 18/21] [FIX] account: reconcile invoice, refund in foreign; payment and writeoff in domestic This reverts 0164c9dfcb8f94dd09ffc5a0ce056e4e23308abe Have exchange rates: Domestic - Domestic: 1.0 Domestic - Foreign : 1.113900 Make an invoice: 480 Foreign Make a credit note: 140 Foreign Make a payment: 287.20 Domestic Reconcile all this with a writeoff: 18.04 Domestic Before this commit, the first invoice was not fully paid this was due to wrong summing of the partial lines that applies to it account.partial.reconcile are made between only 2 move lines at a time Whatever the amounts they hold, it has been computed at creation and it makes no sense to aggregate their rounding error when computing their impact on a move line (because, the information is already lost) After this commit, the use case works, all invoices and payments are fully consumed and reconciled Note that this is a simple use case, no dates or exchange rates involved OPW 2057845 closes odoo/odoo#36087 Signed-off-by: Lucas Perais (lpe) --- addons/account/models/account_move.py | 2 +- addons/account/tests/test_reconciliation.py | 62 +++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 733edb8f565..df9172ab88c 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -343,7 +343,7 @@ class AccountMoveLine(models.Model): else: date = partial_line.credit_move_id.date if partial_line.debit_move_id == line else partial_line.debit_move_id.date rate = line.currency_id.with_context(date=date).rate - amount_residual_currency += sign_partial_line * partial_line.amount * rate + amount_residual_currency += sign_partial_line * line.currency_id.round(partial_line.amount * rate) #computing the `reconciled` field. reconciled = False diff --git a/addons/account/tests/test_reconciliation.py b/addons/account/tests/test_reconciliation.py index 4259dd50583..0149558976f 100644 --- a/addons/account/tests/test_reconciliation.py +++ b/addons/account/tests/test_reconciliation.py @@ -964,3 +964,65 @@ class TestReconciliation(AccountingTestCase): partner_lines = [line for line in report_lines if line['partner_id'] == partner.id] self.assertEqual(partner_lines, [], 'The aged receivable shouldn\'t have lines at this point') self.assertFalse(amls.get(partner.id, False), 'The aged receivable should not have amls either') + + def test_inv_refund_foreign_payment_writeoff_domestic(self): + company = self.env.ref('base.main_company') + self.env['res.currency.rate'].search([]).unlink() + self.env['res.currency.rate'].create({ + 'name': time.strftime('%Y') + '-07-01', + 'rate': 1.0, + 'currency_id': self.currency_euro_id, + 'company_id': company.id + }) + self.env['res.currency.rate'].create({ + 'name': time.strftime('%Y') + '-07-01', + 'rate': 1.113900, # Don't change this ! + 'currency_id': self.currency_usd_id, + 'company_id': self.env.ref('base.main_company').id + }) + inv1 = self.create_invoice(invoice_amount=480, currency_id=self.currency_usd_id) + inv2 = self.create_invoice(type="out_refund", invoice_amount=140, currency_id=self.currency_usd_id) + + payment = self.env['account.payment'].create({ + 'payment_method_id': self.inbound_payment_method.id, + 'payment_type': 'inbound', + 'partner_type': 'customer', + 'partner_id': inv1.partner_id.id, + 'amount': 287.20, + 'journal_id': self.bank_journal_euro.id, + 'company_id': company.id, + }) + payment.post() + + inv1_receivable = inv1.move_id.line_ids.filtered(lambda l: l.account_id.internal_type == 'receivable') + inv2_receivable = inv2.move_id.line_ids.filtered(lambda l: l.account_id.internal_type == 'receivable') + pay_receivable = payment.move_line_ids.filtered(lambda l: l.account_id.internal_type == 'receivable') + + data_for_reconciliation = [ + { + 'type': 'partner', + 'id': inv1.partner_id.id, + 'mv_line_ids': (inv1_receivable + inv2_receivable + pay_receivable).ids, + 'new_mv_line_dicts': [ + { + 'credit': 18.04, + 'debit': 0.00, + 'journal_id': self.bank_journal_euro.id, + 'name': 'Total WriteOff (Fees)', + 'account_id': self.diff_expense_account.id + } + ] + } + ] + + self.env['account.move.line'].process_reconciliations(data_for_reconciliation) + + self.assertTrue(inv1_receivable.full_reconcile_id.exists()) + self.assertEquals(inv1_receivable.full_reconcile_id, inv2_receivable.full_reconcile_id) + self.assertEquals(inv1_receivable.full_reconcile_id, pay_receivable.full_reconcile_id) + + self.assertTrue(inv1.reconciled) + self.assertTrue(inv2.reconciled) + + self.assertEquals(inv1.state, 'paid') + self.assertEquals(inv2.state, 'paid') From 61ad8a9ea70671bf5059c65aa3aae10b8ae1ce71 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Tue, 27 Aug 2019 08:24:10 +0000 Subject: [PATCH 19/21] [FIX] website_event_sale: event discount Fine-tuning 180866fe1e3b8998cc47ee584abaaff76d4135bb - Go to Sales > Configuration > Settings - Enable "Multiple Sales Prices per Product" and select option "Prices computed from formulas (discounts, margins, roundings)" - Go to Sales > Catalog / Pricelists - Select "Public Pricelist" and set "Discount Policy: Show public price & discount to the customer" - Add a discount to an event (20 % to "Open Days in Los Angeles" for example) - Go to the eCommerce, buy a ticket to "Open Days in Los Angeles" which as a 20 % discount Since 180866fe1e3b8998cc47ee584abaaff76d4135bb the discount is applied two times. opw-2058709 closes odoo/odoo#36106 Signed-off-by: Nicolas Martinelli (nim) --- addons/website_event_sale/models/sale_order.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/website_event_sale/models/sale_order.py b/addons/website_event_sale/models/sale_order.py index 58c56bc9441..05e81f2605b 100644 --- a/addons/website_event_sale/models/sale_order.py +++ b/addons/website_event_sale/models/sale_order.py @@ -41,7 +41,10 @@ class SaleOrder(models.Model): values['product_id'] = ticket.product_id.id values['event_id'] = ticket.event_id.id values['event_ticket_id'] = ticket.id - values['price_unit'] = ticket.price_reduce + if order.pricelist_id.discount_policy == 'without_discount': + values['price_unit'] = ticket.price + else: + values['price_unit'] = ticket.price_reduce values['name'] = "%s\n%s" % (ticket.event_id.display_name, ticket.name) # avoid writing related values that end up locking the product record From 55d1c66c8efdd432603e777fe3fe4e74a6e9275d Mon Sep 17 00:00:00 2001 From: "Florimond Husquinet (fhu)" Date: Wed, 28 Aug 2019 14:08:01 +0000 Subject: [PATCH 20/21] [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"), "<"); } From c40236eb16936553ed6df52a4546a5a40fd86809 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 28 Aug 2019 11:58:55 +0000 Subject: [PATCH 21/21] [FIX] account: adapt test to new version Oversight of previous forward-port. closes odoo/odoo#36181 Signed-off-by: Christophe Simonis --- addons/account/tests/test_reconciliation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/tests/test_reconciliation.py b/addons/account/tests/test_reconciliation.py index 5bcb87accf0..974b4073a5c 100644 --- a/addons/account/tests/test_reconciliation.py +++ b/addons/account/tests/test_reconciliation.py @@ -1091,7 +1091,7 @@ class TestReconciliation(AccountingTestCase): 'mv_line_ids': (inv1_receivable + inv2_receivable + pay_receivable).ids, 'new_mv_line_dicts': [ { - 'credit': 18.04, + 'credit': 20.09, # 18.04 in foreign currency 'debit': 0.00, 'journal_id': self.bank_journal_euro.id, 'name': 'Total WriteOff (Fees)', @@ -1101,7 +1101,7 @@ class TestReconciliation(AccountingTestCase): } ] - self.env['account.move.line'].process_reconciliations(data_for_reconciliation) + self.env["account.reconciliation.widget"].process_move_lines(data_for_reconciliation) self.assertTrue(inv1_receivable.full_reconcile_id.exists()) self.assertEquals(inv1_receivable.full_reconcile_id, inv2_receivable.full_reconcile_id)