python-field-not-found (ODOO007)#
Python code names a field the model does not have.
What it does#
Checks the field names and paths (partner_id.country_id.code) in model
classes against the models of the addons path, following relational fields
to their comodel:
@api.depends,@api.onchangeand@api.constrains;related=,currency_field=and the inverse field of aOne2many;the field names of a field’s
domain(on its comodel);_rec_nameand_order;mapped(),filtered()andsorted()with a string onself.
Why is this bad?#
Odoo refuses most of these when it loads the model (“Field x does not
exist”, or an invalid related or _order), and the rest fail when the
code runs. A field defined in a module outside depends works only on a
database where that module happens to be installed: the message names it.
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, and a path through a model the index does not know stops
there without a report.