diff options
| author | fwi-odoo <fwi@odoo.com> | 2017-06-12 10:36:59 +0200 |
|---|---|---|
| committer | fwi-odoo <fwi@odoo.com> | 2017-06-12 11:14:55 +0200 |
| commit | b6a08dc982d3f27006f62b6b2ba2e75547b63e75 (patch) | |
| tree | 2d421ecfbe47e70fcce4d4c65e25d44cfcdbf4a1 /addons/web/static/src | |
| parent | 1aff1e3de8cacd5e69239c649271013fa2f4a017 (diff) | |
[FIX] web: hide 'duplicate' action for ir.model.fields
It shouldn't be possible to duplicate ir.model.fields. Add attribute
´duplicate´ which can be set to false to hide the duplication option in the
action menu.
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/form_view.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/form_view.js b/addons/web/static/src/js/views/form_view.js index faa9bae26cd..e40598741b4 100644 --- a/addons/web/static/src/js/views/form_view.js +++ b/addons/web/static/src/js/views/form_view.js @@ -208,9 +208,10 @@ var FormView = View.extend(common.FieldManagerMixin, { if (this.fields_view.toolbar) { this.sidebar.add_toolbar(this.fields_view.toolbar); } + var canDuplicate = this.is_action_enabled('create') && this.is_action_enabled('duplicate'); this.sidebar.add_items('other', _.compact([ this.is_action_enabled('delete') && { label: _t('Delete'), callback: this.on_button_delete }, - this.is_action_enabled('create') && { label: _t('Duplicate'), callback: this.on_button_duplicate } + canDuplicate && { label: _t('Duplicate'), callback: this.on_button_duplicate } ])); $node = $node || this.$('.oe_form_sidebar'); |
