upgrade-renamed-19 (U1990)#
A model or field that Odoo 19.0 renamed, or a model it merged into another.
Applies to Odoo 19.0 and later.
What it does#
Reports what Odoo 19.0 renamed:
models, also those merged into another: in strings of the Python code (
env["..."],_inherit, comodels) and in themodelattributes and model fields of data files;fields: on records whose model the code shows (
selfin a model,env["..."], variables and loops over them): attribute access, the values ofwrite()andcreate(), domains ofsearch(), paths ofmapped()andfiltered(),@api.depends()andrelated=; in data files the fields of views (not of sub-views), ofxpathexpressions and of records;XML ids, with their module: in
ref,inherit_id,groups,t-call, menuparentandaction,ref()inevaland%(...)dof data files, and inenv.ref(),has_group()and_for_xml_id().
Why is this bad?#
The old name no longer exists: env["..."] raises a KeyError, an
_inherit stops the registry from loading, a view or data file fails to
install, and Python code fails where it reads the field.
Fix safety#
Safe for a rename: the new name replaces the old one. A merged model is
reported without a fix, as its fields and behaviour changed too; so is a
model renamed into one of another shape (product.packaging into
product.uom in 19.0).
Limitations#
The data comes from the migration scripts of
OpenUpgrade, so it covers Odoo’s own
modules. Docstrings, migration scripts, version guards on the old or the
new name (if "x" in self.env:), and models and fields the module defines
itself are skipped, as are the names other rules report (groups_id, …).
Fields reached through another field (line.tax_id in a loop over
self.order_line) are not checked.