xml-id-not-found (ODOO005)#

A reference to an XML id that does not exist, comes from outside depends, or is loaded later.

What it does#

Checks the XML ids a module refers to: ref="...", parent and action of menus, inherit_id, groups, t-call, %(...)d, ref('...') in eval, the :id columns of CSV files, and env.ref() and has_group() in Python. A record with another module’s id (id="base.main_company") is not checked: Odoo creates it when it is missing.

It reports an id that does not exist, one from a module that depends does not reach, and one of the module itself that is defined in a later data file (or further down, or only in demo data).

Why is this bad?#

Odoo resolves the reference while it loads the record: the module fails to install with “External ID not found”. Outside depends, it works only on a database where the other module happens to be installed. In Python, the error comes when the code runs. A groups of an element in a view is the exception: for a missing group Odoo only logs a warning, and the element is shown to no one.

Configuration#

Like ODOO004, the check needs the dependencies, Odoo’s included, in addons-path; a module whose dependencies cannot all be found is not checked. env.ref(..., raise_if_not_found=False) is not reported.