summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-09-07 14:43:48 +0200
committerChristophe Simonis <chs@odoo.com>2018-09-07 14:43:48 +0200
commit49c3264ce0f73a746f9a229dba423f6c0ea3d485 (patch)
tree9cd4603a7b9708d061802f9e0f638e5c684d15a9 /addons/web/static/src/js/fields
parentb4c72220c72e22328b3a96024c59d79889b71ae5 (diff)
parent4850fb08385de3f0851a732c97c90402e89838b7 (diff)
[MERGE] forward port branch saas-11.3 up to 4850fb08385
Diffstat (limited to 'addons/web/static/src/js/fields')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js7
-rw-r--r--addons/web/static/src/js/fields/relational_fields.js5
2 files changed, 6 insertions, 6 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js
index 4a3f3230ef7..a7bd0fd5e8d 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -447,7 +447,7 @@ var FieldDate = InputField.extend({
this.datewidget = this._makeDatePicker();
this.datewidget.on('datetime_changed', this, function () {
var value = this._getValue();
- if ((!value && this.value) || (value && !value.isSame(this.value))) {
+ if ((!value && this.value) || (value && !this._isSameValue(value))) {
this._setValue(value);
}
});
@@ -2348,19 +2348,18 @@ var FieldDomain = AbstractField.extend({
// Convert char value to array value
var value = this.value || "[]";
- var domain = Domain.prototype.stringToArray(value);
// Create the domain selector or change the value of the current one...
var def;
if (!this.domainSelector) {
- this.domainSelector = new DomainSelector(this, this._domainModel, domain, {
+ this.domainSelector = new DomainSelector(this, this._domainModel, value, {
readonly: this.mode === "readonly" || this.inDialog,
filters: this.fsFilters,
debugMode: session.debug,
});
def = this.domainSelector.prependTo(this.$el);
} else {
- def = this.domainSelector.setDomain(domain);
+ def = this.domainSelector.setDomain(value);
}
// ... then replace the other content (matched records, etc)
return def.then(this._replaceContent.bind(this));
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js
index deccd3d7709..25722cd3db9 100644
--- a/addons/web/static/src/js/fields/relational_fields.js
+++ b/addons/web/static/src/js/fields/relational_fields.js
@@ -578,10 +578,11 @@ var FieldMany2One = AbstractField.extend({
* @param {OdooEvent} ev
*/
_onInputKeyup: function (ev) {
- if (ev.which === $.ui.keyCode.ENTER) {
- // If we pressed enter, we want to prevent _onInputFocusout from
+ if (ev.which === $.ui.keyCode.ENTER || ev.which === $.ui.keyCode.TAB) {
+ // If we pressed enter or tab, we want to prevent _onInputFocusout from
// executing since it would open a M2O dialog to request
// confirmation that the many2one is not properly set.
+ // It's a case that is already handled by the autocomplete lib.
return;
}
this.isDirty = true;