ir.attachment: fields, relations and API
The ir.attachment model ("Attachment") is a persistent model declared by the Base module, then extended by 19 other modules. It exposes 36 fields, 30 of them declared directly on the model; 33 fields from other models point to it. Below you will find every field with its technical name, type, label and relations, followed by an Odoo 19 JSON-2 API call.
Model identity
- Technical name
ir.attachment- Label
- Attachment
- Type
- Persistent (models.Model)
- SQL table
ir_attachment- Origin module
- Base (
base) - Extended by
- bus, html_editor, mail, product, account, account_edi, api_doc, attachment_indexation, cloud_storage, cloud_storage_azure, cloud_storage_google, cloud_storage_migration, hr_expense, hr_fleet, hr_recruitment, website, l10n_fr_pdp, mrp, website_forum
- Default order (_order)
id desc- Inherits from (mixins)
- bus.listener.mixin
Model fields
30 own fields, 0 inherited from mixins and 6 automatic ORM fields. Click a name to get a direct link to that field.
36 of 36 fields shown
| Technical name | Label | Type | Details |
|---|---|---|---|
| access_token | Access Token | char | |
| checksum | Checksum/SHA1 | char | read-only |
| company_id | Company | many2one | |
| datas | File Content (base64) | binary | computed |
| db_datas | Database Data | binary | |
| description | Description | text | |
| file_size | File Size | integer | read-only |
| has_thumbnail | Has Thumbnail | boolean | computed added by Discuss ( |
| image_height | Image Height | integer | computed added by HTML Editor ( |
| image_src | Image Src | char | computed added by HTML Editor ( |
| image_width | Image Width | integer | computed added by HTML Editor ( |
| index_content | Indexed Content | text | read-only |
| key | Key | char | added by Website ( |
| local_url | Attachment URL | char | computed added by HTML Editor ( |
| mimetype | Mime Type | char | read-only |
| name | Name | char | required |
| original_id | Original (unoptimized, unresized) attachment | many2one | added by HTML Editor ( |
| public | Is public document | boolean | |
| raw | File Content (raw) | binary | computed |
| res_field | Resource Field | char | |
| res_id | Resource ID | many2one_reference | |
| res_model | Resource Model | char | |
| res_name | Resource Name | char | computed |
| store_fname | Stored Filename | char | |
| theme_template_id | Theme Template | many2one | added by Website ( |
| thumbnail | Thumbnail | image | added by Discuss ( |
| type | Type You can either upload a file from your computer or copy/paste an internet link to your file. | selection | required Values: |
| url | Url | char | |
| voice_ids | Voice | one2many | inverse: added by Discuss ( |
| website_id | Website | many2one→ website | added by Website ( |
| create_date | Created on | datetime | read-onlyautomatic |
| create_uid | Created by | many2one | read-onlyautomatic |
| display_name | Display Name | char | read-onlycomputedautomatic |
| id | ID | integer | read-onlyautomatic |
| write_date | Last Updated on | datetime | read-onlyautomatic |
| write_uid | Last Updated by | many2one | read-onlyautomatic |
Relations
Models linked from this model
- discuss.voice.metadata: voice_ids
- ir.attachment: original_id
- res.company: company_id
- theme.ir.attachment: theme_template_id
- website: website_id
Fields of other models pointing here
- account.bank.statement: attachment_ids
- account.edi.document: attachment_id
- account.move: invoice_pdf_report_id, ubl_cii_xml_id
- applicant.get.refuse.reason: attachment_ids
- applicant.send.mail: attachment_ids
- discuss.voice.metadata: attachment_id
- fleet.vehicle.send.mail: attachment_ids
- hr.employee: message_main_attachment_id
- hr.leave: supported_attachment_ids
- hr.leave.type: icon_id
- ir.attachment: original_id
- l10n.fr.pdp.reports.flow: payload_id
- mail.activity: attachment_ids
- mail.compose.message: attachment_ids
- mail.group.message: attachment_ids
- mail.mail: unrestricted_attachment_ids
- mail.message: attachment_ids
- mail.scheduled.message: attachment_ids
- mail.template: attachment_ids
- mail.template.preview: attachment_ids
- mail.thread.main.attachment: message_main_attachment_id
- mailing.mailing: attachment_ids
- pos.config: self_ordering_image_background_ids, self_ordering_image_home_ids
- product.document: ir_attachment_id
- project.task: displayed_image_id
- quotation.document: ir_attachment_id
- res.config.settings: pos_self_ordering_image_background_ids, pos_self_ordering_image_home_ids
- slide.channel.invite: attachment_ids
- snailmail.letter: attachment_id
- survey.invite: attachment_ids
Reading this model through the API
Odoo 19 JSON-2 API call reading the first five records with real fields of the model. Replace the instance, database and API key with your own.
curl -X POST "https://your-instance.odoo.com/json/2/ir.attachment/search_read" \
-H "Authorization: bearer $ODOO_API_KEY" \
-H "X-Odoo-Database: your-db" \
-H "Content-Type: application/json" \
-d '{"domain":[],"fields":["name","type","company_id","original_id","theme_template_id"],"limit":5}'import requests
BASE_URL = "https://your-instance.odoo.com/json/2"
headers = {"Authorization": f"bearer {API_KEY}", "X-Odoo-Database": "your-db"}
res = requests.post(
f"{BASE_URL}/ir.attachment/search_read",
headers=headers,
json={"domain": [], "fields": ["name","type","company_id","original_id","theme_template_id"], "limit": 5},
)
res.raise_for_status()
print(res.json())- External API access requires Odoo's Custom plan.
- XML-RPC and JSON-RPC will be removed in Odoo 22 (fall 2028): use JSON-2.
- The access rights and record rules of the key's user apply.
Cite this tool
Writing a tutorial, internal documentation or a forum answer? Copy this link to send your readers to the up-to-date reference.
<a href="https://aidoo.ai/en/outils/explorateur-modeles-odoo/ir-attachment">ir.attachment (Odoo 19.0)</a>Sources
Data verified on September 23, 2026 · Odoo 19.0 Community
Have an Odoo project, or want to put your ERP to work with AI? Let's talk
Implementation, custom module development, connecting Claude or ChatGPT to your data: tell us about your context and we will reply within 24 business hours.