[IMP] attachment_preview: Disable base Odoo sidebar

Odoo's default attachment sidebar can show up in views with
`<div class="o_attachment_preview" />`.
Our attachment sidebar would show up on top of it, making the base Odoo
sidebar obsolete. ➔ We disable it.
This commit is contained in:
Houzéfa Abbasbhay 2024-04-24 18:24:01 +02:00
parent 80717b4ad6
commit 8e6a26c424
No known key found for this signature in database
GPG Key ID: B30E9425D9198EC1
2 changed files with 13 additions and 0 deletions

View File

@ -20,6 +20,7 @@
"attachment_preview/static/src/js/mail_models/attachment_card.esm.js",
"attachment_preview/static/src/js/mail_models/attachment_list.esm.js",
"attachment_preview/static/src/js/web_views/binary_field.esm.js",
"attachment_preview/static/src/js/web_views/form_controller.esm.js",
"attachment_preview/static/src/js/web_views/form_renderer.esm.js",
"attachment_preview/static/src/scss/attachment_preview.scss",
"attachment_preview/static/src/xml/attachment_preview.xml",

View File

@ -0,0 +1,12 @@
/** @odoo-module **/
import {FormController} from "@web/views/form/form_controller";
import {patch} from "@web/core/utils/patch";
patch(FormController.prototype, "attachment_preview.FormController", {
/* Defined in addons/mail/static/src/views/form/form_controller.js.
* This method controls Odoo's default attachment sidebar, which only shows
* up based on screen size. Superseded by this module; we disable it. */
hasAttachmentViewer() {
return false;
},
});