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 b60cdff83ed..0c199c37c42 100644 --- a/addons/mail/static/src/components/attachment_card/attachment_card.js +++ b/addons/mail/static/src/components/attachment_card/attachment_card.js @@ -11,7 +11,7 @@ export class AttachmentCard extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'mail.attachment_card', propNameAsRecordLocalId: 'attachmentCardLocalId' }); + useComponentToModel({ fieldName: 'component', modelName: 'AttachmentCard', propNameAsRecordLocalId: 'attachmentCardLocalId' }); } //-------------------------------------------------------------------------- @@ -19,10 +19,10 @@ export class AttachmentCard extends Component { //-------------------------------------------------------------------------- /** - * @returns {mail.attachment_card} + * @returns {AttachmentCard} */ get attachmentCard() { - return this.messaging && this.messaging.models['mail.attachment_card'].get(this.props.attachmentCardLocalId); + return this.messaging && this.messaging.models['AttachmentCard'].get(this.props.attachmentCardLocalId); } } diff --git a/addons/mail/static/src/models/attachment/attachment.js b/addons/mail/static/src/models/attachment/attachment.js index abf4c1301ad..5604144131b 100644 --- a/addons/mail/static/src/models/attachment/attachment.js +++ b/addons/mail/static/src/models/attachment/attachment.js @@ -282,7 +282,7 @@ registerModel({ /** * States the attachment cards that are displaying this attachment. */ - attachmentCards: one2many('mail.attachment_card', { + attachmentCards: one2many('AttachmentCard', { inverse: 'attachment', isCausal: true, }), 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 7249e7d846e..df6296ea01a 100644 --- a/addons/mail/static/src/models/attachment_card/attachment_card.js +++ b/addons/mail/static/src/models/attachment_card/attachment_card.js @@ -5,7 +5,7 @@ import { attr, many2one } from '@mail/model/model_field'; import { insert, insertAndReplace, replace } from '@mail/model/model_field_command'; registerModel({ - name: 'mail.attachment_card', + name: 'AttachmentCard', identifyingFields: ['attachmentList', 'attachment'], lifecycleHooks: { _created() { diff --git a/addons/mail/static/src/models/attachment_list/attachment_list.js b/addons/mail/static/src/models/attachment_list/attachment_list.js index c53c7c5fcd8..da6a8f9682c 100644 --- a/addons/mail/static/src/models/attachment_list/attachment_list.js +++ b/addons/mail/static/src/models/attachment_list/attachment_list.js @@ -67,7 +67,7 @@ registerModel({ /** * States the attachment cards that are displaying this nonImageAttachments. */ - attachmentCards: one2many('mail.attachment_card', { + attachmentCards: one2many('AttachmentCard', { compute: '_computeAttachmentCards', inverse: 'attachmentList', isCausal: true,