upgrade-inherit-read (U2029)#
Code reads ._inherit at runtime, which raises in Odoo 20.0.
Applies to Odoo 20.0 and later.
What it does#
Reports reads of x._inherit, such as "mail.thread" in self._inherit.
Why is this bad?#
Odoo 20.0 raises AttributeError on runtime reads of _inherit (the
class attribute in a class body is fine). Test the class instead:
isinstance(self, self.env.registry["mail.thread"]).