diff options
| author | Lucas Lefèvre <lul@odoo.com> | 2019-09-09 14:57:04 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2019-09-10 11:46:01 +0000 |
| commit | 50d2f188f80fd5f13f72b352962ec12e099b8751 (patch) | |
| tree | 09d9fc578e385898cdea8bfad4ab97438d049e33 /addons/web/static | |
| parent | 55a4910b2ea196223fff9f8b5d3f90cf21c23cd5 (diff) | |
[FIX] web: Display archive action if active in view
Since ee5e972, "Achive" and "Unarchive" actions are
automatically displayed in the actions dropdown
if the record has an `active` field.
The "Archive" action is shown if `active=True`, and
"Unarchive" otherwise.
However, if the record has the `active` field but
it's not in the view, the form controller think
`active=False` because `undefined` is falsy.
Therefore, the "Unarchive" action is always shown.
If `active` is not in the view, neither "Archive" nor
"Unarchive" should be shown.
closes odoo/odoo#36551
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/web/static')
| -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 3ecd38cfe45..22de0e8d68b 100644 --- a/addons/web/static/src/js/views/form/form_controller.js +++ b/addons/web/static/src/js/views/form/form_controller.js @@ -186,7 +186,7 @@ var FormController = BasicController.extend({ var self = this; if (this.hasSidebar) { var otherItems = []; - if (this.archiveEnabled) { + if (this.archiveEnabled && this.initialState.data.active !== undefined) { var classname = "o_sidebar_item_archive" + (this.initialState.data.active ? "" : " o_hidden") otherItems.push({ label: _t("Archive"), |
