From 5838e47ab504340abc00ade9b8a18289aba1c03a Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 25 Mar 2019 16:44:32 +0000 Subject: [FIX] web: modal in modal => no block mobile On a form view: - we open a modal form view - in this modal we open a modal form view - we close that second modal => the modal is closed and the first one is still opened, but on mobile we can't scroll to above or below the modal. This is because bootstrap remove .modal-open class on body when we close the second modal, but this class is necessary to scroll (this is not much an issue on desktop since scroll is often not necessary). We already had a fix that was weakened in 02a063fd73. With this changeset, we keep .modal-open as long as a modal is opened. Without the change, added test failed with: 10. Modal is said opened (expected: true, result: false) opw-1948423 closes #32106 Signed-off-by: Nicolas Lempereur (nle) --- addons/web/static/src/js/core/dialog.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core/dialog.js b/addons/web/static/src/js/core/dialog.js index 5ba24f57cad..5335689b0b0 100644 --- a/addons/web/static/src/js/core/dialog.js +++ b/addons/web/static/src/js/core/dialog.js @@ -204,13 +204,13 @@ var Dialog = Widget.extend({ this.$modal.remove(); } - if (!isFocusSet) { - var modals = $('body > .modal').filter(':visible'); - if (modals.length) { + var modals = $('body > .modal').filter(':visible'); + if (modals.length) { + if (!isFocusSet) { modals.last().focus(); - // Keep class modal-open (deleted by bootstrap hide fnct) on body to allow scrolling inside the modal - $('body').addClass('modal-open'); } + // Keep class modal-open (deleted by bootstrap hide fnct) on body to allow scrolling inside the modal + $('body').addClass('modal-open'); } }, /** -- cgit v1.2.3 From 03d74f4f76a8d873a15792c1959189d72b407712 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 26 Mar 2019 15:02:41 +0000 Subject: [FIX] web: drag & drop month calendar->keep time In fullcalendar, we have in f5b7ad80f fake moments date with UTC time that are the local time, thus when we move an event to another day, we need to set it as: - the selected year-month-day - the original utc hours (real local hours) -> local hours - the original utc minutes (real local minutes) -> local minutes - the original utc seconds (real local seconds) -> local seconds When it is sent to server, timezone offset will be removed so we will transfer to server the expected datetime in UTC. With this changeset we send server the correct time when a fullcalendar event is "all_day" but the original event was not (eg. drag and dropping event on the month view). Added test without change failed with: - 4. event moved to 27th nov 16h00 +40 hours timezone (expected "2016-11-29 08:00:00", result: "2016-11-27 16:00:00") - 5. expected: "event|6|11/27/2016|16:00:00" result: "event|1|12/09/2016|08:00:00" - 6. expected: "event|1|12/09/2016|08:00:00" result: "event|3|12/10/2016|23:55:05" opw-1955281 closes #32136 Signed-off-by: Nicolas Lempereur (nle) --- addons/web/static/src/js/views/calendar/calendar_model.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views/calendar/calendar_model.js b/addons/web/static/src/js/views/calendar/calendar_model.js index 5316cb24206..057737d674f 100644 --- a/addons/web/static/src/js/views/calendar/calendar_model.js +++ b/addons/web/static/src/js/views/calendar/calendar_model.js @@ -73,9 +73,11 @@ return AbstractModel.extend({ .utc(); } else { // default hours in the user's timezone - start.hours(7).add(-this.getSession().getTZOffset(start), 'minutes'); - end.hours(19).add(-this.getSession().getTZOffset(end), 'minutes'); + start.hours(7); + end.hours(19); } + start.add(-this.getSession().getTZOffset(start), 'minutes'); + end.add(-this.getSession().getTZOffset(end), 'minutes'); } } else { start.add(-this.getSession().getTZOffset(start), 'minutes'); -- cgit v1.2.3 From 85b595e6f0c954b27c9546c77198850b4bd15fcd Mon Sep 17 00:00:00 2001 From: Adrien Dieudonne Date: Wed, 27 Mar 2019 14:25:20 +0000 Subject: [FIX] web: avoid double margins after Many2ManyTags fields Before this commit, there was too much space after Many2ManyTags fields. This was due to the fact that a many2one is embedded in the many2manytags widget. Therefore, the css rule who add margin-bottom was applied twice. e.g.: Tags field in project task form view To fix this, we remove the margin-bottom from the children widgets. Note: This bug is not a big deal in previous versions but in 12.2 margins between fields has been increased in mobile and we clearly saw this issue. Task ID: 1944884 closes odoo/odoo#32193 Signed-off-by: Pierre Paridans --- addons/web/static/src/scss/form_view.scss | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/scss/form_view.scss b/addons/web/static/src/scss/form_view.scss index 99430bd0eed..3d1e03c4fdc 100644 --- a/addons/web/static/src/scss/form_view.scss +++ b/addons/web/static/src/scss/form_view.scss @@ -680,6 +680,11 @@ .o_field_widget { margin-bottom: $o-form-spacing-unit * 2; + + > .o_field_widget { + margin-bottom: 0; + } + &.o_field_boolean { margin-right: 0; } -- cgit v1.2.3 From 98e4540fe9adab8bd0d77fbff7906a5b7fbd01a3 Mon Sep 17 00:00:00 2001 From: Mathieu Duckerts-Antoine Date: Thu, 28 Mar 2019 10:40:44 +0000 Subject: [FIX] web: call super in AbstractAction willStart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit https://github.com/odoo/enterprise/commit/19a144d6af2974e964c6487170e6bca1b14d3898 has modified how libraries are loaded at several places and has introduced a bug in sale_subscription_dashboard where the libraries are no longer loaded at all. We fix that situation by calling super in the willStart method of AbstractAction that inherits from Widget. Abstract actions can now also benefit from the mechanism present in Widget willStart. closes odoo/odoo#32209 Signed-off-by: Géry Debongnie (ged) --- addons/web/static/src/js/chrome/abstract_action.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome/abstract_action.js b/addons/web/static/src/js/chrome/abstract_action.js index a5f98434ddb..c40f831e98e 100644 --- a/addons/web/static/src/js/chrome/abstract_action.js +++ b/addons/web/static/src/js/chrome/abstract_action.js @@ -91,20 +91,20 @@ var AbstractAction = Widget.extend(ActionMixin, { */ willStart: function () { var self = this; + var defs = [this._super.apply(this, arguments)]; if (this.hasControlPanel) { var params = this.controlPanelParams; - var def; if (this.loadControlPanel) { - def = this + defs.push(this .loadFieldView(params.modelName, params.context || {}, params.viewId, 'search') .then(function (fieldsView) { params.viewInfo = { arch: fieldsView.arch, fields: fieldsView.fields, }; - }); + })); } - return $.when(def).then(function () { + return $.when.apply(this, defs).then(function () { var controlPanelView = new self.config.ControlPanelView(params); return controlPanelView.getController(self).then(function (controlPanel) { self._controlPanel = controlPanel; @@ -112,7 +112,7 @@ var AbstractAction = Widget.extend(ActionMixin, { }); }); } - return $.when(); + return $.when.apply(this, defs); }, /** * @override -- cgit v1.2.3