Skip to main content

Import records from another Odoo instance

Project description

License: AGPL-3

Import from remote Odoo database

This module was written to import data from another Odoo database. The idea is that you define which models to import from the other database, and add eventual mappings for records you don’t want to import.

Use cases

  • merging databases

  • one way sync

  • aggregating management data from distributed systems

Configuration

Go to Settings / Remote Odoo import / Import configurations and create a configuration.

After filling in your credentials, select models you want to import from the remote database. If you only want to import a subset of the records, add an appropriate domain.

The import will copy records of all models listed, and handle links to records of models which are not imported depending on the existing field mappings. Field mappings to local records also are a stopping condition. Without those, the import will have to create some record for all required x2x fields, which you probably don’t want.

Probably you’ll want to map records of model res.company, and at least the admin user.

The module doesn’t import one2many fields, if you want to have those, add the model the field in question points to to the list of imported models, possibly with a domain.

If you don’t fill in a remote ID, the addon will use the configured local ID for every record of the model (this way, you can for example map all users in the remote system to some import user in the current system).

For fields that have a uniqueness constraint (like res.users#login), create a field mapping if type unique, then the import will generate a unique value for this field.

For models using references with two fields (like ir.attachment), create a field mapping of type by reference and select the two fields involved. The import will transform known ids (=ids of models you import) to the respective local id, and clean out the model/id fields for unknown models/ids.

Usage

To use this module, you need to:

  1. go to an import configuration and hit the button Run import

  2. be patient, this creates a cronjob which will start up to a minutes afterwards

  3. reload the form, as soon as the cronjob runs you’ll see a field Progress that lets you inspect what was imported already

  4. note that the cronjob also resets the password as soon as it has read it. So for a subsequent import, you’ll have to fill it in again

  5. running an import a second time won’t duplicate data, it should recognize records imported earlier and just update them

Try me on Runbot

Known issues / Roadmap

  • Yes of course this duplicates a lot of connector functionality. Rewrite this with the connector framework, probably collaborate with https://github.com/OCA/connector-odoo2odoo

  • Do something with workflows

  • Support reference fields, while being at it refactor _run_import_map_values to call a function per field type

  • Probably it’s safer and faster to disable recomputation during import, and recompute all fields afterwards

  • Add duplicate handling strategy ‘Overwrite older’

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 smashing it by providing a detailed and welcomed feedback.

Credits

Images

  • Odoo Community Association: Icon.

Contributors

Do not contact contributors directly about help with questions or problems concerning this addon, but use the community mailing list or the appropriate specialized mailinglist for help, and the bug tracker linked in Bug Tracker above for technical issues.

Maintainer

Odoo Community Association

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

Details for the file odoo8_addon_base_import_odoo-8.0.1.0.2-py2-none-any.whl.

File metadata

  • Download URL: odoo8_addon_base_import_odoo-8.0.1.0.2-py2-none-any.whl
  • Upload date:
  • Size: 197.6 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/30.4.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.3

File hashes

Hashes for odoo8_addon_base_import_odoo-8.0.1.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 8fc25170959308516725471d33dcc428b2fa803cd1fb340da373f151b0bcee3f
MD5 57ef19ec1004e6df47e38cc9d7319d9b
BLAKE2b-256 a91d86651449d8073d48a2dd10e34df6f7584da4beb00b1fad5ae52a31831b6d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page