diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-02-11 17:00:35 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-02-11 17:00:35 +0100 |
| commit | 8c29df10e02e6777840ffd7a318472de29f77dd1 (patch) | |
| tree | 49c08eeab2620aa7e91e87256754763400c93376 /addons/web/static/src | |
| parent | 0e71f91fa1ea8df0111d034069dcb92e27c5f0a3 (diff) | |
| parent | 93d736e905e0d3b110c36ee93af341021eba42c4 (diff) | |
[MERGE] forward port branch saas-12.1 up to 93d736e905e
Diffstat (limited to 'addons/web/static/src')
7 files changed, 29 insertions, 10 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js index f26a9cbe737..07646c83273 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -188,12 +188,18 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { // mutex-protected as commitChanges function of x2m has to be aware of // all final changes made to a row. var self = this; - this.savingDef = this.mutex.getUnlockedDef().then(function () { - return self.renderer.commitChanges(recordID || self.handle).then(function () { + var savingDef = $.Deferred(); + this.savingDef = savingDef; + + return this.mutex.getUnlockedDef() + .then(function () { + return self.renderer.commitChanges(recordID || self.handle); + }) + .then(function () { return self.mutex.exec(self._saveRecord.bind(self, recordID, options)); - }); - }); - return this.savingDef; + }) + .then(savingDef.resolve.bind(savingDef)) + .fail(savingDef.resolve.bind(savingDef)); }, /** * @override diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 1bd0782bd36..3e20035734d 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -2480,7 +2480,7 @@ var BasicModel = AbstractModel.extend({ if (field.type === 'many2one' && !record.fieldsInfo[record.viewType][name].__no_fetch) { var localId = (record._changes && record._changes[name]) || record.data[name]; var relatedRecord = self.localData[localId]; - if (!relatedRecord) { + if (!relatedRecord || relatedRecord.data.display_name) { return; } toBeFetched.push({ diff --git a/addons/web/static/src/js/views/control_panel/search/search_bar.js b/addons/web/static/src/js/views/control_panel/search/search_bar.js index 7f0feda4516..77d6d7fa5e9 100644 --- a/addons/web/static/src/js/views/control_panel/search/search_bar.js +++ b/addons/web/static/src/js/views/control_panel/search/search_bar.js @@ -142,6 +142,7 @@ var SearchBar = Widget.extend({ var self = this; this._setupAutoCompletionWidgets(); this.autoComplete = new AutoComplete(this, { + $input: this.$('input'), source: this._getAutoCompleteSources.bind(this), select: this._onAutoCompleteSelected.bind(this), get_search_string: function () { diff --git a/addons/web/static/src/js/widgets/auto_complete.js b/addons/web/static/src/js/widgets/auto_complete.js index 33405aa4196..6dd78f8f730 100644 --- a/addons/web/static/src/js/widgets/auto_complete.js +++ b/addons/web/static/src/js/widgets/auto_complete.js @@ -19,7 +19,7 @@ return Widget.extend({ // to obtain the current search string. init: function (parent, options) { this._super(parent); - this.$input = parent.$el; + this.$input = options.$input; this.source = options.source; this.select = options.select; this.get_search_string = options.get_search_string; @@ -90,14 +90,24 @@ return Widget.extend({ ev.preventDefault(); break; case $.ui.keyCode.RIGHT: + if(self.$input[0].selectionStart < self.search_string.length) { + ev.stopPropagation(); + return; + } self.searching = false; var current = self.current_result; if (current && current.expand && !current.expanded) { self.expand(); self.searching = true; + ev.stopPropagation(); } ev.preventDefault(); break; + case $.ui.keyCode.LEFT: + if(self.$input[0].selectionStart > 0) { + ev.stopPropagation(); + } + break; case $.ui.keyCode.ESCAPE: self.close(); self.searching = false; diff --git a/addons/web/static/src/scss/form_view.scss b/addons/web/static/src/scss/form_view.scss index 697ec4dcd12..5642e656dea 100644 --- a/addons/web/static/src/scss/form_view.scss +++ b/addons/web/static/src/scss/form_view.scss @@ -378,8 +378,8 @@ clear: both; // For the notebook not to have alongside floating elements margin-top: $o-form-spacing-unit * 2; - .nav-tabs > .tab-pane { - min-height: 100px; + .tab-content > .tab-pane { + padding: $o-horizontal-padding 0; } } diff --git a/addons/web/static/src/scss/layout_background.scss b/addons/web/static/src/scss/layout_background.scss index 9c47ac72a27..9b137fde8c1 100644 --- a/addons/web/static/src/scss/layout_background.scss +++ b/addons/web/static/src/scss/layout_background.scss @@ -18,6 +18,9 @@ } } .o_background_footer { + .list-inline-item { + white-space: nowrap; + } ul { border-top: 1px solid $o-brand-odoo; border-bottom: 1px solid $o-brand-odoo; diff --git a/addons/web/static/src/scss/list_view.scss b/addons/web/static/src/scss/list_view.scss index 770508ac1b8..85b9b9f6f07 100644 --- a/addons/web/static/src/scss/list_view.scss +++ b/addons/web/static/src/scss/list_view.scss @@ -52,7 +52,6 @@ } &:not(:empty)::after { margin-left: 6px; - position: absolute; } &.o-sort-up { cursor: n-resize; |
