summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorfwi-odoo <fwi@odoo.com>2017-06-12 10:36:59 +0200
committerfwi-odoo <fwi@odoo.com>2017-06-12 11:14:55 +0200
commitb6a08dc982d3f27006f62b6b2ba2e75547b63e75 (patch)
tree2d421ecfbe47e70fcce4d4c65e25d44cfcdbf4a1 /addons/web/static/src/js
parent1aff1e3de8cacd5e69239c649271013fa2f4a017 (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/js')
-rw-r--r--addons/web/static/src/js/views/form_view.js3
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');