Skip to Content
Menu
This question has been flagged
3 Replies
6272 Views

Hi,

I deleted the Administrator account thinking that it was not necessary but now I can't add new modules, during the installation I always get errors:

KeyError: ('ir.model.data', <function IrModelData.xmlid_lookup at 0x7f636ba222f0>, 'base.user_admin')
ValueError: External ID not found in the system: 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'))]"


So I created again a user called Administrator, I put him all the possible rights on the interface but it is not enough.

According to my researches on the forum I have to make an action on the datanase but I don't know how to do it. Can you help me?

Here's the post I found : https://www.odoo.com/es_ES/forum/ayuda-1/question/v12-restore-deleted-superadmin-user-154213

But I don't know how to fix the problem.


Thanks

PS : Sorry about my English, it's not my native language.


Avatar
Discard

Learning for you: Do never ever delete default entries in Odoo before knowing exactly what you are doing. Do archive/deactivate instead, if you are not sure.

Best Answer

You need to create a new record in ir_mode_data table.

Use following query to create an entry for new admin user:

insert into ir_model_data (name, noupdate, module, res_id, model) values('user_admin', True, 'base', ID_OF_NEW_USER, 'res.users');

Please make sure to replace the ID of the new user by replacing "ID_OF_NEW_USER" in the query.

Avatar
Discard
Best Answer

Hey guys, I did the same. I just don't know how to access the ir_mode_data table. I dont know where to put these values and how to recover my superadmin. Please let me know. Cheers and thank you

Avatar
Discard
Author Best Answer

It works perfectly, thank you very much for your explanations.


@Ermin Trevisan Yes, I realized that. Now I archive or deactivate. Thank you
Avatar
Discard