diff options
| author | Aaron Bohy <aab@odoo.com> | 2020-09-03 11:52:56 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-09-03 13:56:13 +0000 |
| commit | 5bb8b927524d062be32f92eb326ef64091301de1 (patch) | |
| tree | 672146dc0a137dd85ac38041ed7c866c70cd0c9b /addons/web/static/src/js/views/form | |
| parent | 1720d56a392b299625e40d202643aacd844d1870 (diff) | |
[FIX] web: form: Archive action when field not in view
Before this commit, when being in a form view without active field
(the field is defined on the model, but not present in the view),
the action "Unarchive" was available in the Actions menu, even
though the record was actually active.
The issue has been introduced by [1]. This commit restores the
previous behavior: when the active field isn't in the view, the
Archive/Unarchive action isn't available in the Actions menu.
[1] 220eb4db391d8ba49dd26bdd3d8af1c27b433d78
closes odoo/odoo#57038
X-original-commit: 97b70aab69b491443d862847fbff69c4e29274af
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/form')
| -rw-r--r-- | addons/web/static/src/js/views/form/form_controller.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/form/form_controller.js b/addons/web/static/src/js/views/form/form_controller.js index c3acdf71e0a..81327f36598 100644 --- a/addons/web/static/src/js/views/form/form_controller.js +++ b/addons/web/static/src/js/views/form/form_controller.js @@ -195,7 +195,7 @@ var FormController = BasicController.extend({ const props = this._super(...arguments); const activeField = this.model.getActiveField(state); const otherActionItems = []; - if (this.archiveEnabled && activeField) { + if (this.archiveEnabled && activeField in state.data) { if (state.data[activeField]) { otherActionItems.push({ description: _t("Archive"), |
