mail_attachments_selector
The upload control on Odoo's document send wizard. It routes files through the messaging layer rather than creating attachments directly, and every file it adds is marked so it can be cleaned up later.
| Technical name | mail_attachments_selector |
|---|---|
| Field types | json |
| Views | form |
| Module | account, present wherever Invoicing or Accounting is installed |
| Used in core | 1 occurrence, the document send wizard in account |
| Versions | Odoo 20.0, Odoo 19.0 |
| No-code setup | No. The field holds a structured value the server builds |
| Alternatives | mail_attachments, many2many_binary, account_file_uploader, binary |
What the attachment selector does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
model | companion field | Read by literal name on the wizard. The technical model of the document being sent, used to resolve the thread the upload targets. |
res_ids | companion field | Read by literal name and parsed as JSON. Only the first id is used to resolve the thread, so a batch send uploads against the first document. |
Two fields are read literally. The widget takes the target model from one field and the record ids from another, parsing the second as JSON, in order to resolve the thread it uploads against. Neither is declared as a dependency, so both have to be present on the wizard; without them the upload cannot resolve a target.
Working examples
Uploading through the chatter's own path
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. The development branch renames the file and the registered name to a send-specific name and adds its own stylesheet. |
| Odoo 19.0 | Verified | First version. Verified against the shipped source. |
| Odoo 18.0 | Not available | Widget does not exist. |
| Odoo 17.0 | Not available | Widget does not exist. |
| Odoo 16.0 | Not available | Widget does not exist. |
Upgrade note. The widget is new in Odoo 19, so there is nothing to migrate from earlier versions. Going forward is the direction that needs attention, because the name changes on the development branch. See the Odoo 20 section.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Uploading does nothing | The wizard does not carry the model or record ids fields the widget reads by literal name. Add both fields to the wizard model and the view. |
| The uploaded file is attached to the wrong document | Only the first record id is used to resolve the thread on a batch send. Expected. Attach per document rather than through a batch wizard if it matters. |
| Uploaded files vanish | The wizard was closed without being saved, and the list widget deletes manual uploads in that case. Complete the send, or re-upload after saving. |
| The file does not appear in the list | The list widget is pointed at a different field. Both widgets must reference the same field; they are two views of one value. |
| Options are ignored | The registration has no extractor. Nothing to configure here. |
| The upload control disappeared after upgrading | The registered name changes on the Odoo 20 development branch. Update custom views to the new widget name during the upgrade. |
Attachment selector vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
mail_attachments_selector | Adding files to a send wizard whose attachment list is a structured value | Uploads through the messaging attachment service against the document's own thread, then appends a flagged entry |
| mail_attachments | Displaying and removing the same list | The paired widget; it renders and cleans up, this one uploads |
| many2many_binary | A plain list of attached files on a real relation | Backed by a relation, with its own upload button and no thread routing |
| account_file_uploader | Creating documents from uploaded files | Creates records from the upload rather than attaching to an existing one |
| binary | A single file on a record | One field, one file, no list |
Frequently asked questions
How is this different from mail_attachments?+
Where do uploaded files end up?+
Why does a batch send attach to only one document?+
Does it support any options?+
What happens to it in Odoo 20?+
Invoices that arrive with everything attached
Terms, delivery notes, electronic invoicing files and the odd one-off document all have to reach the customer with the invoice. We configure and test Odoo document sending end to end, on versions 16 through 19.
Book a free consultation