A client decided to delete the superadmin user from their Odoo 12 installation, so they're now receiving errors. They created a new user and linked the "Administrator" partner to that user.
For example, when installing the Leaves module they get errors like:
KeyError: ('ir.model.data', <function IrModelData.xmlid_lookup at 0x7f6c422089d8>, 'base.user_admin')
ValueError: <class 'ValueError'>: "External ID not found in the system: base.user_admin" while evaluating "[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
ValueError: External ID not found in the system: base.user_admin
I have tried creating a new user and changing its ID to 2 directly in the res_users table trying to replicate the deleted user, but it doesn't seem to have any effect.
Where does Odoo define which user is the super user if it's not hardcoded by id? Where should I look/what should I change? Any ideas?