summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/relational_fields.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
-rw-r--r--addons/web/static/src/js/fields/relational_fields.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js
index b5b6d7252e5..50aeb461ee5 100644
--- a/addons/web/static/src/js/fields/relational_fields.js
+++ b/addons/web/static/src/js/fields/relational_fields.js
@@ -42,18 +42,14 @@ var M2ODialog = Dialog.extend({
this.name = name;
this.value = value;
this._super(parent, {
- title: _.str.sprintf(_t("Create a %s"), this.name),
+ title: _t(`New ${this.name}`),
size: 'medium',
buttons: [{
text: _t('Create'),
classes: 'btn-primary',
+ close: true,
click: function () {
- if (this.$("input").val() !== ''){
- this.trigger_up('quick_create', { value: this.$('input').val() });
- this.close(true);
- } else {
- this.$("input").focus();
- }
+ this.trigger_up('quick_create', { value: this.value });
},
}, {
text: _t('Create and edit'),
@@ -62,7 +58,7 @@ var M2ODialog = Dialog.extend({
click: function () {
this.trigger_up('search_create_popup', {
view_type: 'form',
- value: this.$('input').val(),
+ value: this.value,
});
},
}, {
@@ -71,10 +67,6 @@ var M2ODialog = Dialog.extend({
}],
});
},
- start: function () {
- this.$("p").text(_.str.sprintf(_t("You are creating a new %s, are you sure it does not exist yet?"), this.name));
- this.$("input").val(this.value);
- },
/**
* @override
* @param {boolean} isSet