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.

109 lines
3.5 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. Base Import Match
  6. =================
  7. By default, when importing data (like CSV import) with the ``base_import``
  8. module, Odoo follows this rule:
  9. #. If you import the XMLID of a record, make an **update**.
  10. #. If you do not, **create** a new record.
  11. This module allows you to set additional rules to match if a given import is an
  12. update or a new record.
  13. This is useful when you need to sync heterogeneous databases, and the field you
  14. use to match records in those databases with Odoo's is not the XMLID but the
  15. name, VAT, email, etc.
  16. After installing this module, the import logic will be changed to:
  17. #. If you import the XMLID of a record, make an **update**.
  18. #. If you do not:
  19. #. If there are import match rules for the model you are importing:
  20. #. Discard the rules that require fields you are not importing.
  21. #. Traverse the remaining rules one by one in order to find a match in
  22. the database.
  23. #. If one match is found:
  24. #. Stop traversing the rest of valid rules.
  25. #. **Update** that record.
  26. #. If zero or multiple matches are found:
  27. #. Continue with the next rule.
  28. #. If all rules are exhausted and no single match is found:
  29. #. **Create** a new record.
  30. #. If there are no match rules for your model:
  31. #. **Create** a new record.
  32. Configuration
  33. =============
  34. To configure this module, you need to:
  35. #. Go to *Settings > Technical > Database Structure > Import Match*.
  36. #. *Create*.
  37. #. Choose a *Model*.
  38. #. Choose the *Fields* that conform an unique key in that model.
  39. #. *Save*.
  40. In that list view, you can sort rules by drag and drop.
  41. Usage
  42. =====
  43. To use this module, you need to:
  44. #. Follow steps in **Configuration** section above.
  45. #. Go to any list view.
  46. #. Press *Import* and follow the import procedure as usual.
  47. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  48. :alt: Try me on Runbot
  49. :target: https://runbot.odoo-community.org/runbot/149/8.0
  50. Roadmap / Known Issues
  51. ======================
  52. * Add a filter to let you apply some rules only to incoming imports that match
  53. a given criteria (like a domain, but for import data).
  54. * Matching by VAT for ``res.partner`` records will only work when the partner
  55. has no contacts, because otherwise Odoo reflects the parent company's VAT in
  56. the contact, and that results in multiple matches. Fixing the above point
  57. should make this work.
  58. Bug Tracker
  59. ===========
  60. Bugs are tracked on `GitHub Issues
  61. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  62. check there if your issue has already been reported. If you spotted it first,
  63. help us smashing it by providing a detailed and welcomed `feedback
  64. <https://github.com/OCA/
  65. server-tools/issues/new?body=module:%20
  66. base_import_match%0Aversion:%20
  67. 8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  68. Credits
  69. =======
  70. Contributors
  71. ------------
  72. * Jairo Llopis <yajo.sk8@gmail.com>
  73. Maintainer
  74. ----------
  75. .. image:: https://odoo-community.org/logo.png
  76. :alt: Odoo Community Association
  77. :target: https://odoo-community.org
  78. This module is maintained by the OCA.
  79. OCA, or the Odoo Community Association, is a nonprofit organization whose
  80. mission is to support the collaborative development of Odoo features and
  81. promote its widespread use.
  82. To contribute to this module, please visit https://odoo-community.org.