Blog
Apr 22, 2025 - 3 MIN READ
Clean Fix for the ‘Model Not in Registry’ Error in Odoo Addons

Clean Fix for the ‘Model Not in Registry’ Error in Odoo Addons

Troubleshoot missing Odoo models by checking addon paths, dependencies, cached Python files, and module loading order.

Koderstory

Koderstory

You build a custom module that extends product.category or product.template, add the Product module as a dependency, and then Odoo stops with an error like:

TypeError: Model 'product.template' does not exist in registry.

The Product app may appear installed, but Odoo still has to find and load its source code before it can register those models.

Check the common causes

First, inspect addons_path in odoo.conf. If the Community addons directory is missing or ordered incorrectly, Odoo may not load core modules such as product. Confirm the expected module exists on disk, for example at /srv/odoo_ce/addons/product.

Next, check the custom module manifest. A module that inherits Product models should declare the dependency:

'depends': [
    'base',
    'product',
],

Dependencies tell Odoo which modules must load first. They cannot compensate for an addon folder that Odoo cannot find.

Stale .pyc files from an older build can also make a development or deployment environment behave unexpectedly. Clear compiled files in the affected custom addon directory when you have confirmed they are safe to regenerate:

find /srv/erp/odoo_addons -name '*.pyc' -delete
find /srv/erp/odoo_addons -type d -name '__pycache__' -exec rm -rf {} +

Load modules in the right order

Make sure the core addons path comes before optional Enterprise and custom addon paths. Then restart Odoo and update the dependency and your custom module together:

/srv/odoo_ce/odoo-bin \
  -c /srv/erp/odoo.conf \
  -d erp \
  -u product,mycustom_categorycode \
  --stop-after-init

Review the startup logs to confirm product loads before the custom addon. With the path, manifest dependency, and module order aligned, Odoo can register the inherited models before initializing your code.

Originally published on Koderstory Devlog.