mail_composer_attachment_list
The attachment rows under Odoo's email composer are the mail_composer_attachment_list widget: a stripped-down many2many_binary that lists, opens and deletes, but never uploads.
| Technical name | mail_composer_attachment_list |
|---|---|
| Field types | many2many (ir.attachment) |
| Views | form (composer and scheduled message dialogs) |
| Module | mail, shipped with every Odoo database |
| Used in core | 3 occurrences in the mail module: composer and scheduled message dialogs |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0 |
| No-code setup | Not applicable: it targets the composer models, not user forms |
| Alternatives | many2many_binary, binary, html_composer_message |
What the composer attachment list does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
accepted_file_extensions | string | Inherited from many2many_binary: comma-separated extensions for the file picker. Inert here because this template renders no upload button. |
number_of_files | integer | Inherited from many2many_binary: hides the upload button once the count is reached. Inert here for the same reason, there is no upload button to hide. |
Inherited but inert. accepted_file_extensions and number_of_files are passed through to props exactly as on the parent widget, but this subclass's template contains no upload button, so there is no file picker for them to constrain. They only matter if you re-add an uploader in a further subclass.
Working examples
What exactly happens when you click the cross
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Rebuilt on the Many2XBinary component on the development branch, same behavior contract. See below. |
| Odoo 19.0 | Verified | Verified against the shipped source; composer bus optional, ir.attachment store model. |
| Odoo 18.0 | Verified | First release. Crashes on removal when mounted outside the full composer, fixed in 19. |
| Odoo 17.0 | Not available | Does not exist; the composer used a different attachment presentation. |
| Odoo 16.0 | Not available | Does not exist. |
Upgrade note for 18 to 19. No XML changes. Two internals changed: the mail store lookup moved to the ir.attachment store model, and the composer bus became optional, fixing the standalone crash. Patches against the 18 class should be rechecked.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| No button to add files in the list | By design: the subclass template removes the uploader. Attach through the composer's paperclip or paste into the body; or use many2many_binary on custom wizards. |
| Removed an attachment and it vanished from the source record too | Only attachments whose res_model is mail.compose.message are deleted; record-owned files are merely detached. Check where the file actually lived; record attachments survive removal from the email. |
| Pasted image still shows in the body after removing its row | The body sync needs the composer bus; outside the full composer environment nothing listens to ATTACHMENT_REMOVED. Remove the image in the body editor as well, or run inside the standard composer dialog. |
| accepted_file_extensions seems ignored | The option configures an upload control this widget does not render. Enforce extensions where the upload happens, or switch to many2many_binary. |
| Widget errors on file removal in a custom 18 view | Odoo 18 triggered the composer bus unconditionally. Upgrade to 19, or provide a fullComposerBus in the environment, or patch the trigger with optional chaining. |
Composer attachment list vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
mail_composer_attachment_list | Reviewing and pruning attachments before an email goes out | List-and-remove only, deletes pending uploads server side, syncs with the body |
| many2many_binary | Attachment fields that should upload as well as list | Standard uploader with extension and count options active |
| binary | A single file on a record | One value, filename handling via a companion char field |
| html_composer_message | The message body the attachments accompany | The other half of the composer pair, connected over the same bus |
Frequently asked questions
Why is there no upload button on the composer attachment list?+
Does removing an attachment delete the file?+
How does the list stay in sync with images pasted in the body?+
Can I use mail_composer_attachment_list on my own model?+
Which options does it support?+
What changes in Odoo 20?+
Attachment flows that never send the wrong file
From composer wizards with document checklists to automatic attachment rules per email template, we build the guardrails around Odoo's mailing stack that keep contracts, quotes and revisions straight. One misfiled PDF to a customer costs more than the fix.
Tighten my email attachment flow