OdooWiki OCA HUB

Base Import Match

base_import_match folder_open OCA/server-backend open_in_new
Tools License: AGPL-3

By default, when importing data (like CSV import) with the base_import module, Odoo follows this rule:

  • If you import the XMLID of a record, make an update.
  • If you do not, create a new record.

This module allows you to set additional rules to match if a given import is an update or a new record.

This is useful when you need to sync heterogeneous databases, and the field you use to match records in those databases with Odoo's is not the XMLID but the name, VAT, email, etc.

After installing this module, the import logic will be changed to:

  • If you import the XMLID of a record, make an update.
  • If you do not:
  • If there are import match rules for the model you are importing:
  • Discard the rules that require fields you are not importing.
  • Traverse the remaining rules one by one in order to find a match in the database.
  • Skip the rule if it requires a special condition that is not satisfied.
  • If one match is found:
  • Stop traversing the rest of valid rules.
  • Update that record.
  • If zero or multiple matches are found:
  • Continue with the next rule.
  • If all rules are exhausted and no single match is found:
  • Create a new record.
  • If there are no match rules for your model:
  • Create a new record.

By default 2 rules are installed for production instances:

  • One rule that will allow you to update companies based on their VAT, when is_company is True.
  • One rule that will allow you to update users based on their login.

In demo instances there are more examples.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Lets you define matching rules so that CSV imports update existing records instead of creating duplicates, based on fields like VAT, email or name rather than the external ID.

When you import data with Odoo's standard import tool, Odoo normally creates a new record unless the file contains an external ID. This module changes that behaviour: you can configure match rules that tell Odoo which combination of fields identifies an existing record.

  • A new menu "Import Match" (under the Technical/Settings area) lets administrators create rules per model. Each rule lists one or more fields that together form a unique key, and rules are tried in order.
  • A field inside a rule can be marked as conditional: the rule is only used when the imported value for that field exactly equals the value you set (for example, only match companies when the imported is_company value is exactly "True").
  • During import, rules whose fields are not present in the imported file are ignored. The remaining rules are checked one by one; if exactly one existing record matches, that record is updated. If none or several records match, Odoo falls back to creating a new record.
  • The module ships ready-made rules: partners are matched by VAT (for companies), users by login, and demo rules match partners by name plus parent company, by email, or by name.
  • It affects the import behaviour of any model through the shared load method, and adds the base_import.match and base_import.match.field models. Only system administrators can create or change rules; other users can read them.

Depends on

base_import

Menus it adds

match_menu
Models and fields (3)
  • base · extends an existing model
  • base_import.match · new modelname, model_id, sequence, field_ids (Fields), model_name (Model name)
  • base_import.match.field · new modelname, field_id (Field), match_id (Match), model_id, conditional, imported_value

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 7 confirmed, 2 with no information of 9 versions.

Sources · Odoo 13.0

Confirmed on 2026-11-03 in branch 13.0 of OCA/server-backend.

terminal Installation and usage

OCA documentation · Odoo 18.0

To configure this module, you need to:

  • Go to Settings \> Technical \> Database Structure \> Import Match.
  • Create.
  • Choose a Model.
  • Choose the Fields that conform a unique key in that model.
  • If the rule must be used only for certain imported values, check Conditional and enter the exact string that is going to be imported in Imported value.
  • Keep in mind that the match here is evaluated as a case sensitive text string always. If you enter e.g. True, it will match that string, but will not match 1 or true.
  • Save.

In that list view, you can sort rules by drag and drop.

To use this module, you need to:

  • Follow steps in Configuration section above.
  • Go to any list view.
  • Press Import and follow the import procedure as usual.

No verified information in OCA: Installation.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.