Odoo Insights

Fix external ID errors in Odoo without stopping operations

External ID errors block data imports, module updates, and integrations in Odoo. This guide shows how to troubleshoot and resolve these errors in minutes using practical checks and command-line fixes.

2026-05-10 · 12 minutes

When your Odoo import or update fails with an external ID error

You’re importing customer data or updating a module and the process stops with an error like this:

External ID not found: 'base.res_partner_1'

The screen shows red text and the operation halts. You might see this during:

  • Data import from a CSV or Excel file
  • Module upgrade or installation in Apps
  • Integration with external systems such as ERPNext or Salesforce

This error means Odoo cannot find a record that your import or update is trying to reference. The risk is that the process stops midway, leaving partial data or breaking the module. Operations staff and junior engineers often face this when moving modules between Odoo instances or after a version upgrade.

The error itself does not tell you whether the missing record was deleted, renamed, or never existed. That’s what you need to diagnose next.

What an external ID actually is and why it matters

In Odoo, an external ID is a unique text label that points to a database record. It looks like model_name.external_reference. For example, base.res_partner_1 refers to the first partner record in the base module.

Odoo uses these IDs to link data across modules and imports. When you import a CSV with a field that references a partner, Odoo looks up the partner by its external ID. If it’s missing, the import fails with an external ID error.

External IDs are stored in the ir_model_data table. You can think of this table as a phonebook: it maps human-readable names to database IDs. When Odoo says an external ID is not found, it means the name in the phonebook does not exist.

Common causes of missing external IDs include:

  • Deleting a record that was referenced elsewhere
  • Restoring a backup that does not include the external ID
  • Upgrading Odoo versions where the model or ID changed
  • Copying data between instances without copying the ir_model_data table

Quick checks to confirm the problem before diving deeper

Check 1: Look at the exact error message

Copy the full error text from the Odoo log or the import report. The message usually shows the missing external ID like:

External ID not found: 'account.data_account_type_receivable'

Note the module prefix (account) and the external reference (data_account_type_receivable). This tells you which module’s data is missing.

Check 2: Compare Odoo versions

If you recently upgraded Odoo, some external IDs may have changed between versions. For example, in Odoo 15 the account chart structure was reorganized. If you restore a backup from Odoo 14 into Odoo 15, the external IDs for account types may no longer exist.

Open the Odoo Apps list and check the version of each module. If a module is from an older version, it may reference external IDs that no longer exist in your current version.

Check 3: Verify the module’s presence and integrity

Go to Apps > search for the module mentioned in the error (e.g., Accounting). If the module is not installed, the external IDs it provides will be missing. If the module is installed but the error persists, the module may be corrupted or partially installed.

To check module integrity, open the Odoo shell and run:

./odoo-bin -d your_db_name --db_user=odoo --db_password=your_password -i base --update=all --stop-after-init

What this does: It initializes the base module and updates all modules. If the external ID is still missing, the module’s data is not being created properly during initialization. This often happens after a failed upgrade or a partial restore.

Success looks like: The command completes without errors and the external ID appears in ir_model_data.

Step-by-step fixes for the most common scenarios

Scenario A: The missing external ID belongs to a core module

Example: base.res_partner_1 is missing during a customer import.

Step 1 — Restore the missing record

If the record should exist, restore it from a backup or from a working Odoo instance. You can export the record from the working instance and import it into the problematic instance.

Step 2 — Reinstall the module

Go to Apps > search for the module (e.g., Contacts) > click Reinstall. This recreates the default data for the module, including external IDs.

Step 3 — Update the module

After reinstalling, update the module to ensure all data is synchronized:

  • Go to Apps > find the module > click the dropdown > Upgrade.
  • If the upgrade fails, check the logs for specific errors and resolve them first.

Scenario B: The missing external ID belongs to a custom addon

Example: custom_sale.sale_order_type_standard is missing during a sale order import.

Step 1 — Check the custom module’s code

Open the custom addon’s data/ folder. Look for XML or CSV files that define the external ID. The file might be named sale_data.xml or similar.

Search for the missing ID in the file. If it’s missing, add it back using the same structure as other records in the file.

Step 2 — Update the module

Go to Apps > find the custom module > click the dropdown > Upgrade. This loads the updated data files and recreates the external IDs.

Step 3 — Verify data integrity

Run the following SQL query in your database to check if the external ID now exists:

SELECT * FROM ir_model_data WHERE module = 'custom_sale' AND name = 'sale_order_type_standard';

What this does: It checks the ir_model_data table for the missing external ID. If the query returns a row, the ID exists.

Success looks like: A single row with the correct module and name.

Scenario C: The external ID is missing after an integration

Example: An import from Salesforce fails with crm.lead_type_hot missing.

Step 1 — Check the integration mapping

Open the integration settings in Odoo (see Integration settings). Look at the field mappings for leads. If the integration tries to assign a lead type that does not exist in Odoo, the import fails.

Step 2 — Create missing records in Odoo

Go to CRM > Configuration > Lead Types. Add the missing type (e.g., “Hot Lead”) and save. Note the external ID that Odoo assigns automatically (e.g., crm.lead_type_hot).

Step 3 — Retry the integration

Run the integration again. If the mapping was updated correctly, the import should now succeed.

How to verify the fix and prevent future errors

Verify the external ID exists

Use the Odoo shell to confirm the external ID is present:

./odoo-bin -d your_db_name --db_user=odoo --db_password=your_password -c /etc/odoo/odoo.conf --shell

Once in the shell, run:

env['ir.model.data'].search([('module', '=', 'account'), ('name', '=', 'data_account_type_receivable')])

What this does: It searches the ir_model_data table for the external ID. If it returns a record, the ID exists.\p

Success looks like: A record with id, module, and name fields populated.\p

Check data consistency after the fix

After fixing the external ID, re-run the original import or update. If it succeeds, check a sample of the imported data to confirm it is correct. For example, if you imported customers, open a few customer records and verify the fields are populated as expected.\p

Prevent future errors

  • Backup before updates: Always back up your database before upgrading modules or Odoo versions. See Odoo pricing and backup options for automated solutions.\p
  • Test in staging: Use a staging environment to test module upgrades and data imports before applying them in production.\p
  • Review custom addons: If you use custom addons (see Custom addons guide), audit their data files regularly to ensure external IDs are present and correct.\p
  • Document external IDs: Keep a list of critical external IDs for your instance. This helps during troubleshooting and migrations.\p

When to seek help and what information to provide

Triggers to escalate

Escalate to your Odoo administrator or support if:

  • The error persists after reinstalling the module and updating data
  • The external ID is missing in both production and staging instances
  • The error appears during a critical operation (e.g., month-end close)
  • You suspect data corruption or a failed restore

What to include in your request

When you contact support, provide:

  • The exact error message and screenshot
  • The Odoo version and module versions (from Apps > Technical > Modules)
  • The recent changes (e.g., module upgrade, data import, restore)
  • The output of the verification commands above
  • A backup of the database (if possible)

Where to get help

For self-service, check the Odoo Implementation Guide and the Custom Addons documentation. For paid support, review Odoo pricing plans that include technical support.

Decision guide: What to do first based on the symptom

Symptom First action Next step if unresolved
The error shows a core module external ID (e.g., base.res_partner_1) Reinstall the Contacts module Upgrade the module and check logs
The error shows a custom addon external ID (e.g., custom_sale.sale_order_type_standard) Upgrade the custom module Check the custom module’s data files and reinstall
The error appears after an integration import Check integration mappings and create missing records in Odoo Review integration logs and retry with corrected data
The error persists after multiple attempts Check ir_model_data table for corruption and restore from backup Escalate to support with logs and backup

Risk of ignoring external ID errors and next steps

Ignoring an external ID error can lead to:

  • Partial data imports that break downstream processes
  • Module upgrades that fail silently, causing instability
  • Integration failures that disrupt sales or operations

If you see an external ID error today, take 5 minutes to run the quick checks in this guide. Use the verification commands to confirm whether the external ID exists. If it’s missing, apply the fix that matches your scenario and verify the data is correct.

Do not proceed with critical operations until the error is resolved. If the error is in a production environment and you are unsure, contact your Odoo administrator or support immediately.

Your immediate action today: Check the Odoo logs for external ID errors using the command below. If you find one, follow the decision guide to resolve it before your next data import or module upgrade.

grep -i "External ID not found" /var/log/odoo/odoo-server.log

What this does: It searches the Odoo server log for the exact error message. If it returns lines, you have an external ID error to fix.

Practical Next Step

Check your Odoo logs now for external ID errors using the quick commands

Discuss Your Odoo Scope

FAQ

Why does Odoo use external IDs instead of just using database IDs?

Odoo uses external IDs to make data portable and version-independent. A database ID is a number that changes when you restore a backup or migrate data. An external ID is a text label that stays the same even if the database changes. This allows Odoo to link data across different instances, versions, and environments without breaking references.

Can I manually add a missing external ID using SQL?

Yes, but only if you know the correct values. You can insert a row into the ir_model_data table using SQL. However, this bypasses Odoo’s data integrity checks and can cause issues later. Always prefer using Odoo’s module data files or the UI to add external IDs. If you must use SQL, back up your database first and test in a staging environment.

What’s the difference between reinstalling a module and upgrading it?

Reinstalling a module drops and recreates its database tables and data. This is useful when the module’s data is corrupted or missing. Upgrading a module only applies new or changed data files. Upgrading is safer and faster, but reinstalling is more thorough for fixing missing data.

How do I find which module an external ID belongs to?

Look at the prefix before the dot in the external ID. For example, in account.data_account_type_receivable, the prefix account tells you the ID belongs to the Accounting module. You can also search the ir_model_data table by the name column to find the module.

Can external ID errors cause data loss?

External ID errors themselves do not cause data loss, but they can block imports or upgrades that would otherwise add or update data. If you ignore the error and proceed with partial data, you may end up with inconsistent or missing records. Always resolve external ID errors before continuing critical operations to avoid data corruption or loss.