Odoo 19.0 Community · Persistent

mail.template: fields, relations and API

The mail.template model ("Email Templates") is a persistent model declared by the Discuss module, then extended by 3 other modules. It exposes 35 fields, 26 of them declared directly on the model; 35 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
mail.template
Label
Email Templates
Type
Persistent (models.Model)
SQL table
mail_template
Origin module
Discuss (mail)
Extended by
account, event, pos_self_order
Default order (_order)
user_id, name, id
Inherits from (mixins)
mail.render.mixintemplate.reset.mixinpos.load.mixin

Model fields

26 own fields, 3 inherited from mixins and 6 automatic ORM fields. Click a name to get a direct link to that field.

35 of 35 fields shown

Technical nameLabelTypeDetails
activeActiveboolean
attachment_idsAttachmentsmany2many
auto_deleteAuto Delete

This option permanently removes any track of email after it's been sent, including from the Technical menu in the Settings, in order to preserve storage space of your Odoo database.

boolean
body_htmlBodyhtml
translatable
can_writeCan Write

The current user can edit the template.

boolean
computed
descriptionTemplate Description

This field is used for internal description of the template's usage.

text
translatable
email_ccCc

Carbon copy recipients (placeholders may be used here)

char
email_fromSend From

Sender address (placeholders may be used here). If not set, the default value will be the author's email alias if configured, or email address.

char
email_layout_xmlidEmail Notification Layoutchar
email_toTo (Emails)

Comma-separated recipient addresses (placeholders may be used here)

char
has_dynamic_reportsHas Dynamic Reportsboolean
computed
has_mail_serverHas Mail Serverboolean
computed
is_template_editorIs Template Editorboolean
computed
mail_server_idOutgoing Mail Server

Optional preferred server for outgoing mails. If not set, the highest priority one will be used.

many2one
modelRelated Document Modelchar
read-only

related: model_id.model

model_idApplies tomany2one
nameNamechar
translatable
partner_toTo (Partners)

Comma-separated ids of recipient partners (placeholders may be used here)

char
ref_ir_act_windowSidebar action

Sidebar action to make this template available on records of the related document model

many2one
read-only
reply_toReply To

Email address to which replies will be redirected when sending emails in mass; only used when the reply is not logged in the original discussion thread.

char
report_template_idsDynamic Reportsmany2many
scheduled_dateScheduled Date

If set, the queue manager will send the email after the date. If not set, the email will be send as soon as possible. You can use dynamic expression.

char
subjectSubject

Subject (placeholders may be used here)

char
translatable
template_categoryTemplate Categoryselection
computed

Values: base_template (Base Template), hidden_template (Hidden Template), custom_template (Custom Template)

use_default_toDefault Recipients

Default recipients of the record: - partner (using id on a partner or the partner_id field) OR - email (using email_from or email field)

boolean
user_idOwnermany2one
langLanguage

Optional translation language (ISO code) to select when sending out an email. If not set, the main partner's language will be used. This should usually be a placeholder expression that provides the appropriate language, e.g. {{ object.partner_id.lang }}.

char

inherited from mail.render.mixin

render_modelRendering Modelchar
computed

inherited from mail.render.mixin

template_fsTemplate Filename

File from where the template originates. Used to reset broken template.

char

inherited from template.reset.mixin

create_dateCreated ondatetime
read-onlyautomatic
create_uidCreated bymany2one
read-onlyautomatic
display_nameDisplay Namechar
read-onlycomputedautomatic
idIDinteger
read-onlyautomatic
write_dateLast Updated ondatetime
read-onlyautomatic
write_uidLast Updated bymany2one
read-onlyautomatic

Relations

Models linked from this model

Fields of other models pointing here

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
curl -X POST "https://your-instance.odoo.com/json/2/mail.template/search_read" \
  -H "Authorization: bearer $ODOO_API_KEY" \
  -H "X-Odoo-Database: your-db" \
  -H "Content-Type: application/json" \
  -d '{"domain":[],"fields":["name","mail_server_id","model_id","ref_ir_act_window","user_id"],"limit":5}'
Python (requests)
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}/mail.template/search_read",
    headers=headers,
    json={"domain": [], "fields": ["name","mail_server_id","model_id","ref_ir_act_window","user_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/mail-template">mail.template (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.