Import the chatter history of your records
Link imported messages, attachments and activities to their record by its XML ID, without knowing database ids.
One column
A res_external_id column with the XML ID of the
record sets both the model and the id of the document.
Messages, files, to-dos
Works for chatter messages, attachments and activities, and for messages that carry their attachments.
Nothing lost
An XML ID that does not exist stops the import with a clear error, instead of creating a message that is linked to nothing.
How to import a history
Import the attachments first, then the messages that refer to them.
Both point to their record with res_external_id:
1. Attachments (ir.attachment)
| id | name | raw | res_external_id |
|---|---|---|---|
legacy.att_contract |
Service contract 2016.pdf | JVBERi0... | legacy.p_vermeer |
2. Messages (mail.message)
| body | author_id/id | date | res_external_id | attachment_ids/id |
|---|---|---|---|---|
| Contract signed | legacy.anna |
2016-03-03 09:05:00 | legacy.p_vermeer |
legacy.att_contract |
3. Activities (mail.activity)
| activity_type_id/id | summary | date_deadline | user_id/id | res_external_id |
|---|---|---|---|---|
mail.mail_activity_data_call |
Renew the contract | 2026-12-01 | legacy.user_anna |
legacy.p_vermeer |
The messages keep their author and date. The usual access rights apply to the record the message, attachment or activity is linked to.
Good to know
-
Import the records themselves with
"mail_create_nolog": Truein the context, so that Odoo does not add a created message of today. - Exports fill the column with the XML ID of the record, for a round trip between databases.
- Keep the creator and creation date of messages and attachments with Import Metadata. Part of the Fluvo toolset for fast data import and export in Odoo. Open source under the LGPL-3 license.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 84 |
| Technical Name |
import_res_id |
| License | LGPL-3 |
| Website | https://github.com/GetFluvo/addons |
Please log in to comment on this module