diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-09-15 17:20:01 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-09-15 17:20:01 +0200 |
| commit | ed901bedcb7c8b840ae5cf4731b946e998b8b141 (patch) | |
| tree | 56e555e5c61cf53f72b41302ed8b907570bdfe3f /addons/web/static/src/js/fields/relational_fields.js | |
| parent | 2dea77fe21dae081df71ecf17f275306bb3e5b89 (diff) | |
| parent | 80f916e8e00e740d481251c0c9ea3a5b5a75a908 (diff) | |
[MERGE] forward port branch saas-16 up to 80f916e8e00
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index c2bd4f5d5b8..4cbbf498e82 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -93,8 +93,12 @@ 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.nodeOptions.no_create; - this.can_write = 'can_write' in this.attrs ? this.attrs.can_write : true; + + // should normally also be set, except in standalone M20 + this.can_create = ('can_create' in this.attrs ? JSON.parse(this.attrs.can_create) : true) && + !this.nodeOptions.no_create; + this.can_write = 'can_write' in this.attrs ? JSON.parse(this.attrs.can_write) : true; + this.nodeOptions = _.defaults(this.nodeOptions, { quick_create: true, }); |
