diff --git a/addons/mail/static/src/models/attachment/attachment.js b/addons/mail/static/src/models/attachment/attachment.js index b25a254fbc0..58763f29661 100644 --- a/addons/mail/static/src/models/attachment/attachment.js +++ b/addons/mail/static/src/models/attachment/attachment.js @@ -299,7 +299,7 @@ registerModel({ attachmentLists: many2many('AttachmentList', { inverse: 'attachments', }), - attachmentViewer: many2many('AttachmentViewer', { + attachmentViewers: many2many('AttachmentViewer', { inverse: 'attachments', }), checksum: attr(), 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 10df15719d8..c8194f12881 100644 --- a/addons/mail/static/src/models/attachment_list/attachment_list.js +++ b/addons/mail/static/src/models/attachment_list/attachment_list.js @@ -83,7 +83,7 @@ registerModel({ /** * Determines the attachment viewers displaying this attachment list (if any). */ - attachmentViewer: one2many('AttachmentViewer', { + attachmentViewers: one2many('AttachmentViewer', { inverse: 'attachmentList', isCausal: true, }), diff --git a/addons/mail/static/src/models/attachment_viewer/attachment_viewer.js b/addons/mail/static/src/models/attachment_viewer/attachment_viewer.js index f4ea2429a19..35b691cf01e 100644 --- a/addons/mail/static/src/models/attachment_viewer/attachment_viewer.js +++ b/addons/mail/static/src/models/attachment_viewer/attachment_viewer.js @@ -40,12 +40,12 @@ registerModel({ }), attachment: many2one('mail.attachment'), attachmentList: many2one('AttachmentList', { - inverse: 'attachmentViewer', + inverse: 'attachmentViewers', readonly: true, required: true, }), attachments: many2many('mail.attachment', { - inverse: 'attachmentViewer', + inverse: 'attachmentViewers', related: 'attachmentList.viewableAttachments', }), /**