Mail Message Import
mail_message_import · OCA/social
-
Security22/251 minor finding
-
Activity25/25Human commit this month
-
Required by5/250 modules depend on it
-
Maturity5/25In 1 Odoo series since 18.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
MailMessageImportAddress— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceMailMessageImportConfig— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceMailMessageImportMessage— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · source- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `SELECT id, process_requested FROM mail_message_import_conversation WHERE channel_id = %s AND sender_address = %s AND sender_id = %s AND state = 'open' LIMIT 1 FOR UPDATE` - re-check the table/column names still match after upgrading. (3 occurrences in this file) migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
This module gives Odoo an inbox for the messages that the company receives by several channels (email, WhatsApp...), whatever the channel:
- Receiving channels: the email addresses or phone numbers where the
messages arrive. Each channel is a module (for example
mail_message_import_emailormail_message_import_whatsapp). - Senders and their authorized addresses: the phones and email addresses allowed to send messages on behalf of each sender. A message from any other address waits in Unknown senders until a person assigns it to a sender, and the address can be authorized at the same time.
- Conversations: the consecutive messages of a sender are grouped and processed together once the sender has been silent for some minutes, so that clarifications and corrections are read in context. The conversations are queued, retried when they fail and reported as incidents when they keep failing.
- A panel with a card per receiving channel: unknown senders, incidents, conversations with errors or being processed, and the messages of the last days.
The module does not decide what a conversation means: other modules process them (for example to turn the documents received into orders). Without one, the conversations are just closed once grouped.
Dependencies
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 22
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
mail_message_import_address_view_list |
mail.message.import.address.list | mail.message.import.address | list | New |
mail_message_import_address_view_search |
mail.message.import.address.search | mail.message.import.address | search | New |
mail_message_import_assign_sender_view_form |
mail.message.import.assign.sender.form | mail.message.import.assign.sender | form | New |
mail_message_import_channel_view_form |
mail.message.import.channel.form | mail.message.import.channel | form | New |
mail_message_import_channel_view_kanban |
mail.message.import.channel.kanban | mail.message.import.channel | kanban | New |
mail_message_import_channel_view_list |
mail.message.import.channel.list | mail.message.import.channel | list | New |
mail_message_import_channel_view_search |
mail.message.import.channel.search | mail.message.import.channel | search | New |
mail_message_import_config_view_form |
mail.message.import.config.form | mail.message.import.config | form | New |
mail_message_import_conversation_view_form |
mail.message.import.conversation.form | mail.message.import.conversation | form | New |
mail_message_import_conversation_view_list |
mail.message.import.conversation.list | mail.message.import.conversation | list | New |
mail_message_import_conversation_view_search |
mail.message.import.conversation.search | mail.message.import.conversation | search | New |
mail_message_import_incident_view_form |
mail.message.import.incident.form | mail.message.import.incident | form | New |
mail_message_import_incident_view_kanban |
mail.message.import.incident.kanban | mail.message.import.incident | kanban | New |
mail_message_import_incident_view_list |
mail.message.import.incident.list | mail.message.import.incident | list | New |
mail_message_import_incident_view_search |
mail.message.import.incident.search | mail.message.import.incident | search | New |
mail_message_import_message_view_form |
mail.message.import.message.form | mail.message.import.message | form | New |
mail_message_import_message_view_graph |
mail.message.import.message.graph | mail.message.import.message | graph | New |
mail_message_import_message_view_list |
mail.message.import.message.list | mail.message.import.message | list | New |
mail_message_import_message_view_search |
mail.message.import.message.search | mail.message.import.message | search | New |
mail_message_import_sender_view_form |
mail.message.import.sender.form | mail.message.import.sender | form | New |
mail_message_import_sender_view_list |
mail.message.import.sender.list | mail.message.import.sender | list | New |
mail_message_import_sender_view_search |
mail.message.import.sender.search | mail.message.import.sender | search | New |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 8
-
activeBooleandefault=True -
addressCharhelp='Phone in international format for WhatsApp (+34 600 000 000), email address for email...'required=True -
address_normalizedCharcompute='_compute_address_normalized'help='The address as the channel identifies the senders.'index=Truestore=Truestring='Normalized address' -
authorized_dateDatetimedefault=fields.Datetime.nowreadonly=True -
channel_typeSelectiondefault=<expr>selection='_selection_channel_type'string='Channel' -
company_idMany2onerelated='sender_id.company_id'store=True -
nameCharhelp="Who uses the address, e.g. 'Ana, buyer'."string='Label' -
sender_idMany2one → mail.message.import.senderindex=Trueondelete='cascade'required=True args: 'mail.message.import.sender'
No public methods.
-
authorize_addressBooleandefault=Truehelp='Later messages of the address (the phone, the email address...) will be assigned to the sender directly.'string='Authorize the address' -
message_idsMany2many → mail.message.import.messagestring='Messages' args: 'mail.message.import.message', 'mail_message_import_assign_sender_message_rel', 'wizard_id', 'message_id' -
process_messagesBooleandefault=Truehelp='Process the messages as a conversation of the sender; otherwise they are ignored.'string='Process the messages' -
sender_countIntegercompute='_compute_sender_count' -
sender_idMany2one → mail.message.import.senderrequired=True args: 'mail.message.import.sender'
-
action_assign(self)
-
activeBooleandefault=True -
channel_typeSelectiondefault=<expr>help='How the messages arrive. Each channel is a module.'selection=[]string='Channel' -
company_idMany2one → res.companydefault=<expr>required=True args: 'res.company' -
dashboard_graphTextcompute='_compute_dashboard_graph' -
error_countIntegercompute='_compute_counters' -
last_message_dateDatetimecompute='_compute_counters' -
message_countIntegercompute='_compute_counters' -
nameCharrequired=True -
open_incident_countIntegercompute='_compute_counters' -
sequenceIntegerdefault=10 -
stateSelectioncompute='_compute_state' args: [('not_configured', 'Not configured'), ('pending', 'Pending verification'), ('connected', 'Connected'), ('disabled', 'Disabled')] -
state_messageCharcompute='_compute_state' -
unidentified_countIntegercompute='_compute_counters' -
waiting_countIntegercompute='_compute_counters'
-
action_view_conversations(self) -
action_view_errors(self) -
action_view_incidents(self) -
action_view_messages(self) -
action_view_unidentified(self) -
action_view_waiting(self)
-
company_idMany2one → res.companydefault=<expr>required=True args: 'res.company' -
inactivity_minutesIntegerdefault=3help='Minutes without new messages of a sender before its messages are processed together.'required=True -
max_attemptsIntegerdefault=5help='Attempts to process a conversation before it is left in error.'required=Truestring='Maximum attempts'
-
action_open_company_config(self)@api.model
-
attempt_countIntegerreadonly=True -
authorized_address_idMany2one → mail.message.import.addressreadonly=Truestring='Authorized address' args: 'mail.message.import.address' -
channel_idMany2one → mail.message.import.channelondelete='restrict'readonly=Truerequired=Truestring='Receiving channel' args: 'mail.message.import.channel' -
company_idMany2one → res.companyreadonly=Truerequired=True args: 'res.company' -
first_message_dateDatetimereadonly=True -
incident_idsOne2many → mail.message.import.incidentreadonly=Truestring='Incidents' args: 'mail.message.import.incident', 'conversation_id' -
last_errorTextreadonly=True -
last_message_dateDatetimereadonly=True -
message_countIntegercompute='_compute_counts' -
message_idsOne2many → mail.message.import.messagereadonly=Truestring='Messages' args: 'mail.message.import.message', 'conversation_id' -
nameCharcopy=Falsedefault='/'readonly=Truerequired=True -
next_attempt_dateDatetimeindex=Truereadonly=True -
open_incident_countIntegercompute='_compute_counts' -
origin_displayCharcompute='_compute_origin_display'help='The channel and the phone or email address it came from.'string='Received by' -
process_afterDatetimeindex=Truereadonly=True -
process_requestedBooleanhelp='A person asked to process it without waiting for the inactivity.'readonly=Truestring='Processing requested' -
processed_dateDatetimereadonly=True -
processing_refCharhelp='Identifier of the last attempt.'readonly=Truestring='Processing' -
processing_startDatetimereadonly=True -
sender_addressCharreadonly=Truerequired=Truestring='Address' -
sender_idMany2one → mail.message.import.senderindex=Trueondelete='restrict'readonly=Truerequired=True args: 'mail.message.import.sender' -
stateSelectiondefault='open'index=Truereadonly=Truerequired=True args: [('open', 'Waiting for messages'), ('processing', 'Processing'), ('done', 'Processed'), ('error', 'Error'), ('cancelled', 'Cancelled')]
-
action_process_now(self)Do not wait for the end of the inactivity delay, only for the files sent with the last messages, which arrive some seconds later. -
action_retry(self)Process the conversation again with the next run of the cron. -
action_view_incidents(self) -
create(self, vals_list)@api.model_create_multi -
init(self)
-
authorized_address_idMany2onerelated='conversation_id.authorized_address_id'store=Truestring='Sent from' -
can_retryBooleancompute='_compute_can_retry' -
categorySelectioncompute='_compute_category'store=True args: [('technical', 'Technical error'), ('incomplete', 'Incomplete data'), ('review', 'Human assessment')] -
channel_idMany2one → mail.message.import.channelreadonly=Truestring='Receiving channel' args: 'mail.message.import.channel' -
company_idMany2one → res.companyreadonly=Truerequired=True args: 'res.company' -
conversation_idMany2one → mail.message.import.conversationindex=Truereadonly=True args: 'mail.message.import.conversation' -
descriptionText -
incident_typeSelectionrequired=Truestring='Type' args: [('processing_error', 'Processing error')] -
message_idMany2one → mail.message.import.messagereadonly=True args: 'mail.message.import.message' -
nameCharrequired=Truestring='Summary' -
origin_displayCharrelated='conversation_id.origin_display' -
resolution_noteText -
resolved_by_idMany2one → res.usersreadonly=True args: 'res.users' -
resolved_dateDatetimereadonly=True -
sender_idMany2one → mail.message.import.senderindex=Truereadonly=True args: 'mail.message.import.sender' -
stateSelectiondefault='open'index=Truerequired=Truetracking=True args: [('open', 'Open'), ('resolved', 'Resolved'), ('dismissed', 'Dismissed')]
-
action_dismiss(self) -
action_open_conversation(self) -
action_reopen(self) -
action_resolve(self) -
action_retry(self)Process the conversation again, once the cause is corrected. -
write(self, vals)
-
attachment_countIntegercompute='_compute_attachment_count'string='Number of files' -
attachment_idsMany2many → ir.attachmentreadonly=Truestring='Files' args: 'ir.attachment', 'mail_message_import_message_attachment_rel', 'message_id', 'attachment_id' -
authorized_address_idMany2one → mail.message.import.addressreadonly=Truestring='Authorized address' args: 'mail.message.import.address' -
bodyTextreadonly=Truestring='Text' -
channel_idMany2one → mail.message.import.channelindex=Trueondelete='restrict'readonly=Truerequired=Truestring='Receiving channel' args: 'mail.message.import.channel' -
channel_typeSelectionrelated='channel_id.channel_type'store=True -
company_idMany2one → res.companyreadonly=Truerequired=True args: 'res.company' -
conversation_idMany2one → mail.message.import.conversationindex=Truereadonly=True args: 'mail.message.import.conversation' -
mail_message_idMany2one → mail.messageondelete='set null'readonly=Truestring='Posted message' args: 'mail.message' -
media_pendingBooleanhelp='Its files stay in its channel until the conversation is processed.'readonly=Truestring='Files to download' -
message_dateDatetimereadonly=Truestring='Sent on' -
message_typeSelectionreadonly=Truestring='Type' args: MESSAGE_TYPES -
message_uidCharhelp='Identifier of the message in its channel.'index=Truereadonly=Truerequired=Truestring='Message ID' -
nameCharcompute='_compute_name' -
noteTextreadonly=True -
origin_displayCharcompute='_compute_origin_display'help='The channel and the phone or email address it came from.'string='Received by' -
raw_payloadTexthelp='The message as its channel delivered it.'readonly=Truestring='Original data' -
received_dateDatetimedefault=fields.Datetime.nowreadonly=Truestring='Received on' -
reply_to_uidCharhelp='Identifier of the message it replies to, in its channel.'readonly=Truestring='Reply to' -
sender_addressCharhelp='Address that sent the message: the phone for WhatsApp, the email address for email...'index=Truereadonly=Truestring='Address' -
sender_idMany2one → mail.message.import.senderindex=Trueondelete='restrict'readonly=True args: 'mail.message.import.sender' -
sender_nameCharreadonly=Truestring='Sender name' -
stateSelectiondefault='queued'index=Truereadonly=Truerequired=True args: [('unidentified', 'Unidentified sender'), ('queued', 'Waiting'), ('processed', 'Processed'), ('ignored', 'Ignored')]
-
action_assign_sender(self) -
action_view_attachments(self) -
action_view_conversation(self)
-
activeBooleandefault=Truetracking=True -
address_countIntegercompute='_compute_counters' -
address_idsOne2many → mail.message.import.addressstring='Authorized addresses' args: 'mail.message.import.address', 'sender_id' -
company_idMany2one → res.companydefault=<expr>help='Company that receives the messages of the sender.'required=Truetracking=True args: 'res.company' -
conversation_countIntegercompute='_compute_counters' -
message_countIntegercompute='_compute_counters' -
nameCharrequired=Truetracking=True -
noteText -
open_incident_countIntegercompute='_compute_counters' -
partner_idMany2one → res.partnercheck_company=Truehelp='Contact of the sender in Odoo.'string='Contact' args: 'res.partner'
-
action_view_conversations(self) -
action_view_incidents(self) -
action_view_messages(self) -
write(self, vals)
Loading…