[IMP] mail: rename attachment card model

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) <seb@odoo.com>
This commit is contained in:
Louis Wicket (wil)
2021-12-14 12:40:09 +00:00
parent f1b1286393
commit 98290450c8
4 changed files with 6 additions and 6 deletions
@@ -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);
}
}
@@ -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,
}),
@@ -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() {
@@ -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,