diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index d36ac353461..4f3aa3a8e1f 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2997,8 +2997,11 @@ instance.web.form.FieldRadio = instance.web.form.AbstractField.extend(instance.w })(); /** - * A mixin containing some useful methods to handle completion inputs. - */ + A mixin containing some useful methods to handle completion inputs. + + The widget containing this option can have these arguments in its widget options: + - no_quick_create: if true, it will disable the quick create +*/ instance.web.form.CompletionFieldMixin = { init: function() { this.limit = 7; @@ -3044,7 +3047,8 @@ instance.web.form.CompletionFieldMixin = { } // quick create var raw_result = _(data.result).map(function(x) {return x[1];}); - if (search_val.length > 0 && !_.include(raw_result, search_val)) { + if (search_val.length > 0 && !_.include(raw_result, search_val) && + ! (self.options && self.options.no_quick_create)) { values.push({ label: _.str.sprintf(_t('Create "%s"'), $('').text(search_val).html()),