summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/relational_fields.js
diff options
context:
space:
mode:
authorPratima Gupta <pgu@odoo.com>2018-11-20 06:40:45 +0000
committerVincent Schippefilt <vsc@odoo.com>2019-06-26 09:04:06 +0000
commite719824271a6368ce8b3e5ff2a3f5d5a3399b23c (patch)
tree7b663ad495638aef93db233b5cce9e7783bafeee /addons/web/static/src/js/fields/relational_fields.js
parent83aaea9e5ce92530875e4fca606a89fe423803ef (diff)
[IMP] web: hide "Remove" button in FormViewDialog
When we open any x2m record (in a FormViewDialog), there is a "Remove" button to delete/unlink the opened record from parent. This button is placed besides "Discard" button and it creates little confusion in some cases. For example, in list view, there's already a bin / 'x' icon depending on the field type using which people are used to delete/unlink the record. And when they open a record, they might accidentally click "Remove" button instead of "Discard". To avoid this, now we won't show "Remove" button when we open record from x2many list view. However, we have to keep this button in case x2many of kanban as there's no other way to remove the record. task-1886913 closes odoo/odoo#34333 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
-rw-r--r--addons/web/static/src/js/fields/relational_fields.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js
index 325bb176e61..d50e03540f2 100644
--- a/addons/web/static/src/js/fields/relational_fields.js
+++ b/addons/web/static/src/js/fields/relational_fields.js
@@ -1609,7 +1609,7 @@ var FieldOne2Many = FieldX2Many.extend({
fields_view: this.attrs.views && this.attrs.views.form,
parentID: this.value.id,
viewInfo: this.view,
- deletable: this.activeActions.delete,
+ deletable: this.activeActions.delete && params.deletable,
}));
},
@@ -1714,7 +1714,7 @@ var FieldOne2Many = FieldX2Many.extend({
on_remove: function () {
self._setValue({operation: 'DELETE', ids: [id]});
},
- deletable: this.activeActions.delete,
+ deletable: this.activeActions.delete && this.view.arch.tag !== 'tree',
readonly: this.mode === 'readonly',
});
},
@@ -1788,7 +1788,7 @@ var FieldMany2Many = FieldX2Many.extend({
self._setValue({operation: 'FORGET', ids: [ev.data.id]});
},
readonly: this.mode === 'readonly',
- deletable: this.activeActions.delete,
+ deletable: this.activeActions.delete && this.view.arch.tag !== 'tree',
string: this.string,
});
},