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.

46 lines
1.6 KiB

  1. By default, when importing data (like CSV import) with the ``base_import``
  2. module, Odoo follows this rule:
  3. - If you import the XMLID of a record, make an **update**.
  4. - If you do not, **create** a new record.
  5. This module allows you to set additional rules to match if a given import is an
  6. update or a new record.
  7. This is useful when you need to sync heterogeneous databases, and the field you
  8. use to match records in those databases with Odoo's is not the XMLID but the
  9. name, VAT, email, etc.
  10. After installing this module, the import logic will be changed to:
  11. - If you import the XMLID of a record, make an **update**.
  12. - If you do not:
  13. - If there are import match rules for the model you are importing:
  14. - Discard the rules that require fields you are not importing.
  15. - Traverse the remaining rules one by one in order to find a match in the database.
  16. - Skip the rule if it requires a special condition that is not
  17. satisfied.
  18. - If one match is found:
  19. - Stop traversing the rest of valid rules.
  20. - **Update** that record.
  21. - If zero or multiple matches are found:
  22. - Continue with the next rule.
  23. - If all rules are exhausted and no single match is found:
  24. - **Create** a new record.
  25. - If there are no match rules for your model:
  26. - **Create** a new record.
  27. By default 2 rules are installed for production instances:
  28. - One rule that will allow you to update companies based on their VAT, when
  29. ``is_company`` is ``True``.
  30. - One rule that will allow you to update users based on their login.
  31. In demo instances there are more examples.