upgrade-superuser-id (U1923)#
SUPERUSER_ID is imported from odoo, moved to odoo.api in Odoo 19.0.
Applies to Odoo 19.0 and later.
What it does#
Reports from odoo import SUPERUSER_ID and odoo.SUPERUSER_ID.
Why is this bad?#
Odoo 19.0 moved SUPERUSER_ID to odoo.api, a step towards an odoo
package without variables. odoo.SUPERUSER_ID still works in 19.0, and
Odoo’s own addons still use it in many places, so this is a matter of
keeping up rather than a break.
Opt-in: select it (select = ["ALL", "U1923"]).
Fix#
Imports it from odoo.api (from odoo.api import SUPERUSER_ID, on a line
of its own when the odoo import has other names), and turns
odoo.SUPERUSER_ID into odoo.api.SUPERUSER_ID. Both also work on Odoo
18.0.