diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 20024c076f5d2..1b5ca8de730b1 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3162,7 +3162,12 @@ instance.web.form.Many2OneButton = instance.web.form.AbstractField.extend({ if (this.$button) { this.$button.remove(); } - this.string = this.get('value') ? _t('Edit') : _t('Create'); + var options =py.eval(this.node.attrs.options); + if (options.label) { + this.string = this.get('value') ? _t(options.label.edit) : _t(options.label.create); + } else { + this.string = ''; + } this.node.attrs.icon = this.get('value') ? '/web/static/src/img/icons/gtk-yes.png' : '/web/static/src/img/icons/gtk-no.png'; this.$button = $(QWeb.render('WidgetButton', {'widget': this})); this.$el.append(this.$button);