You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
4.6 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ================================
  5. Import from remote Odoo database
  6. ================================
  7. 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.
  8. Use cases
  9. =========
  10. - merging databases
  11. - one way sync
  12. - aggregating management data from distributed systems
  13. Configuration
  14. =============
  15. Go to Settings / Remote Odoo import / Import configurations and create a configuration.
  16. 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.
  17. 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.
  18. Probably you'll want to map records of model `res.company`, and at least the admin user.
  19. 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.
  20. 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).
  21. 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.
  22. 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.
  23. Usage
  24. =====
  25. To use this module, you need to:
  26. #. go to an import configuration and hit the button ``Run import``
  27. #. be patient, this creates a cronjob which will start up to a minutes afterwards
  28. #. reload the form, as soon as the cronjob runs you'll see a field ``Progress`` that lets you inspect what was imported already
  29. #. 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
  30. #. running an import a second time won't duplicate data, it should recognize records imported earlier and just update them
  31. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  32. :alt: Try me on Runbot
  33. :target: https://runbot.odoo-community.org/runbot/149/8.0
  34. Known issues / Roadmap
  35. ======================
  36. * 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
  37. * Do something with workflows
  38. * Support reference fields, while being at it refactor _run_import_map_values to call a function per field type
  39. * Probably it's safer and faster to disable recomputation during import, and recompute all fields afterwards
  40. * Add duplicate handling strategy 'Overwrite older'
  41. Bug Tracker
  42. ===========
  43. Bugs are tracked on `GitHub Issues
  44. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  45. check there if your issue has already been reported. If you spotted it first,
  46. help us smashing it by providing a detailed and welcomed feedback.
  47. Credits
  48. =======
  49. Images
  50. ------
  51. * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  52. Contributors
  53. ------------
  54. * Holger Brunn <hbrunn@therp.nl>
  55. Do not contact contributors directly about help with questions or problems concerning this addon, but use the `community mailing list <mailto:community@mail.odoo.com>`_ or the `appropriate specialized mailinglist <https://odoo-community.org/groups>`_ for help, and the bug tracker linked in `Bug Tracker`_ above for technical issues.
  56. Maintainer
  57. ----------
  58. .. image:: https://odoo-community.org/logo.png
  59. :alt: Odoo Community Association
  60. :target: https://odoo-community.org
  61. This module is maintained by the OCA.
  62. OCA, or the Odoo Community Association, is a nonprofit organization whose
  63. mission is to support the collaborative development of Odoo features and
  64. promote its widespread use.
  65. To contribute to this module, please visit https://odoo-community.org.