Import Res ID

Beta License: LGPL-3 GetFluvo/addons

Adds a Document XML ID field, res_external_id, to messages (mail.message) and attachments (ir.attachment), to link them to their document by the XML ID of that document.

Messages and attachments point to their document with a model name and a database id, which an import file cannot know. With this field, chatter messages and attachments can be imported for records imported earlier.

Table of contents

Use Cases / Context

When migrating to Odoo, the history of the records, the chatter messages and the attachments, has to be imported too. Without this module the import file needs the database id of every document, which is only known after the documents are imported.

Usage

Import messages or attachments with a res_external_id column holding the complete XML ID of the document, as module.name. The model and the id of the document are set from it:

body message_type res_external_id attachment_ids/id
<p>Called the customer</p> comment legacy.partner_42 legacy.attachment_7

The field can also be given to create() and write(), and is filled in exports with the first XML ID of the document.

When importing a history, import the documents themselves with "mail_create_nolog": True or "tracking_disable": True in the context, so that Odoo does not add a created message of today next to the imported messages. Messages keep the date and author_id of the import file. To also keep their create_uid and create_date, use the import_metadata module.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Fluvo

Other credits

Based on the idea and the res_external_id field of the import_res_id module of easier_import by Thibault Francois. This is a new implementation.

Maintainers

This module is part of the GetFluvo/addons project on GitHub.

You are welcome to contribute.