Import the chatter history of your records

Link imported messages and attachments to their record by its XML ID, without knowing database ids.

Import the chatter history

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 and files

Works for chatter messages and for attachments, 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
Imported messages and attachment in the chatter of a contact

The messages keep their author and date. The usual access rights apply to the record the message or attachment is linked to.

Good to know

  • Import the records themselves with "mail_create_nolog": True in 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.