[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.
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
<record id="view_model_fields_form" model="ir.ui.view">
|
||||
<field name="model">ir.model.fields</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Fields">
|
||||
<form string="Fields" duplicate="false">
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
@@ -315,7 +315,7 @@
|
||||
<record id="view_model_fields_tree" model="ir.ui.view">
|
||||
<field name="model">ir.model.fields</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Fields">
|
||||
<tree string="Fields" duplicate="false">
|
||||
<field name="name"/>
|
||||
<field name="field_description"/>
|
||||
<field name="model_id"/>
|
||||
|
||||
Reference in New Issue
Block a user