diff options
| author | Christophe Matthieu <chm@odoo.com> | 2017-04-26 13:47:32 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2017-04-28 11:32:05 +0200 |
| commit | 9da93dc2327d43958d47a3f1029f8de86fc007ee (patch) | |
| tree | 7d4aae967f28a08383a20df292310c0053971f15 /addons/web/static/src | |
| parent | 76e6a0e3560db8257ab0d183463a894ace1e3a7e (diff) | |
[FIX] web: prevent record creation in M2O with option {'no_create': True}
before this fix, if you enter a random string and exit focus you'll be
prompted to create it.
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 459b529c748..481f5df89ad 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -93,7 +93,7 @@ var FieldMany2One = AbstractField.extend({ this._super.apply(this, arguments); this.limit = 7; this.orderer = new concurrency.DropMisordered(); - this.can_create = 'can_create' in this.attrs ? this.attrs.can_create : true; + this.can_create = ('can_create' in this.attrs ? this.attrs.can_create : true) && !this.nodeOptions.no_create; this.can_write = 'can_write' in this.attrs ? this.attrs.can_write : true; this.nodeOptions = _.defaults(this.nodeOptions, { quick_create: true, |
