diff --git a/addons/mail/static/src/components/attachment_card/attachment_card.js b/addons/mail/static/src/components/attachment_card/attachment_card.js index 77052e1784a..95cf73214bf 100644 --- a/addons/mail/static/src/components/attachment_card/attachment_card.js +++ b/addons/mail/static/src/components/attachment_card/attachment_card.js @@ -1,22 +1,10 @@ /** @odoo-module **/ import { registerMessagingComponent } from '@mail/utils/messaging_component'; -import { useComponentToModel } from '@mail/component_hooks/use_component_to_model/use_component_to_model'; -import { LegacyComponent } from "@web/legacy/legacy_component"; -export class AttachmentCard extends LegacyComponent { +const { Component } = owl; - /** - * @override - */ - setup() { - super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'AttachmentCard' }); - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- +export class AttachmentCard extends Component { /** * @returns {AttachmentCard} diff --git a/addons/mail/static/src/components/attachment_image/attachment_image.js b/addons/mail/static/src/components/attachment_image/attachment_image.js index 69abf40884f..5f3d396c653 100644 --- a/addons/mail/static/src/components/attachment_image/attachment_image.js +++ b/addons/mail/static/src/components/attachment_image/attachment_image.js @@ -1,18 +1,10 @@ /** @odoo-module **/ import { registerMessagingComponent } from '@mail/utils/messaging_component'; -import { useComponentToModel } from '@mail/component_hooks/use_component_to_model/use_component_to_model'; -import { LegacyComponent } from "@web/legacy/legacy_component"; -export class AttachmentImage extends LegacyComponent { +const { Component } = owl; - /** - * @override - */ - setup() { - super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'AttachmentImage' }); - } +export class AttachmentImage extends Component { /** * @returns {AttachmentImage} diff --git a/addons/mail/static/src/models/attachment_card/attachment_card.js b/addons/mail/static/src/models/attachment_card/attachment_card.js index 41b15448c93..6365316ec13 100644 --- a/addons/mail/static/src/models/attachment_card/attachment_card.js +++ b/addons/mail/static/src/models/attachment_card/attachment_card.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registerModel } from '@mail/model/model_core'; -import { attr, one } from '@mail/model/model_field'; +import { one } from '@mail/model/model_field'; import { insertAndReplace, replace } from '@mail/model/model_field_command'; registerModel({ @@ -31,7 +31,6 @@ registerModel({ return; } if (this.attachmentList.composerViewOwner) { - this.component.trigger('o-attachment-removed', { attachmentLocalId: this.attachment.localId }); this.attachment.remove(); } else { this.update({ attachmentDeleteConfirmDialog: insertAndReplace() }); @@ -58,9 +57,5 @@ registerModel({ readonly: true, required: true, }), - /** - * States the OWL component of this attachment card. - */ - component: attr(), }, }); diff --git a/addons/mail/static/src/models/attachment_image/attachment_image.js b/addons/mail/static/src/models/attachment_image/attachment_image.js index 1b54dbc112f..eb345d7905e 100644 --- a/addons/mail/static/src/models/attachment_image/attachment_image.js +++ b/addons/mail/static/src/models/attachment_image/attachment_image.js @@ -31,7 +31,6 @@ registerModel({ return; } if (this.attachmentList.composerViewOwner) { - this.component.trigger('o-attachment-removed', { attachmentLocalId: this.attachment.localId }); this.attachment.remove(); } else { this.update({ attachmentDeleteConfirmDialog: insertAndReplace() }); @@ -100,10 +99,6 @@ registerModel({ readonly: true, required: true, }), - /** - * States the OWL component of this attachment image. - */ - component: attr(), /** * Determines the max height of this attachment image in px. */