From 98290450c8584f64bc816b07dcfedc3600ddf858 Mon Sep 17 00:00:00 2001 From: "Louis Wicket (wil)" Date: Tue, 30 Nov 2021 12:31:58 +0000 Subject: [PATCH] [IMP] mail: rename attachment card model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename javascript model `mail.attachment_card` to `AttachmentCard` in order to distinguish javascript model from python model. Part of task-2701674. closes odoo/odoo#80604 Signed-off-by: Sébastien Theys (seb) --- .../src/components/attachment_card/attachment_card.js | 6 +++--- addons/mail/static/src/models/attachment/attachment.js | 2 +- .../static/src/models/attachment_card/attachment_card.js | 2 +- .../static/src/models/attachment_list/attachment_list.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) 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,