upgrade-renamed-18 (U1890)#

A model or field that Odoo 18.0 renamed, or a model it merged into another.

Applies to Odoo 18.0 and later.

What it does#

Reports what Odoo 18.0 renamed:

  • models, also those merged into another: in strings of the Python code (env["..."], _inherit, comodels) and in the model attributes and model fields of data files;

  • fields: on records whose model the code shows (self in a model, env["..."], variables and loops over them): attribute access, the values of write() and create(), domains of search(), paths of mapped() and filtered(), @api.depends() and related=; in data files the fields of views (not of sub-views), of xpath expressions and of records;

  • XML ids, with their module: in ref, inherit_id, groups, t-call, menu parent and action, ref() in eval and %(...)d of data files, and in env.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.