Based on your persistent issues, let's implement a thorough solution to regain full admin access:
Step 1: Verify Complete Group Assignments
Run this SQL to ensure all admin privileges:
sql
-- For existing admin user
UPDATE res_users SET
password = 'pbkdf2_sha512$600000$ExampleSalt$ExampleHash',
active = true,
share = false
WHERE login = 'admin';
-- Add to ALL security groups (critical for full access)
INSERT INTO res_groups_users_rel (gid, uid)
SELECT g.id, u.id
FROM res_groups g, res_users u
WHERE u.login = 'admin'
AND g.id NOT IN (
SELECT gid FROM res_groups_users_rel WHERE uid = u.id
);
Step 2: Force Password Reset Through Configuration
- Edit your odoo.conf:
ini
admin_passwd = your_new_password
list_db = True
- Restart Odoo completely:
bash
sudo systemctl restart odoo
Step 3: Direct Session Table Cleanup (If Authentication Still Fails)
sql
-- Clear all active sessions for the admin user
DELETE FROM ir_attachment WHERE res_model = 'ir.sessions';
DELETE FROM ir_sessions WHERE uid = (SELECT id FROM res_users WHERE login = 'admin');
Step 4: Verify User Configuration
Run this diagnostic query:
sql
SELECT
u.login,
u.active,
u.share,
array_agg(g.name) as groups
FROM res_users u
LEFT JOIN res_groups_users_rel gu ON gu.uid = u.id
LEFT JOIN res_groups g ON g.id = gu.gid
WHERE u.login = 'admin'
GROUP BY u.login, u.active, u.share;
Step 5: Last Resort - Create New Superuser With Full Rights
sql
DO $$
DECLARE
new_uid integer;
new_partner_id integer;
BEGIN
-- Create partner first
INSERT INTO res_partner (
name, email, company_id, active,
create_uid, create_date, write_uid, write_date
) VALUES (
'Super Admin', 'admin@example.com', 1, true,
1, now(), 1, now()
) RETURNING id INTO new_partner_id;
-- Create user
INSERT INTO res_users (
active, login, password, company_id, partner_id,
create_uid, create_date, write_uid, write_date
) VALUES (
true, 'superadmin', 'pbkdf2_sha512$600000$ExampleSalt$ExampleHash',
1, new_partner_id, 1, now(), 1, now()
) RETURNING id INTO new_uid;
-- Grant all groups
INSERT INTO res_groups_users_rel (gid, uid)
SELECT id, new_uid FROM res_groups;
END $$;
Critical Checks If Still Not Working:
- Database Filter: Verify no --db-filter is blocking access
- Custom Auth Modules: Check installed modules for auth in name
- Password Policy: Look for password_security module
- Odoo Version: Confirm exact version with odoo --version
Final Verification:
After making changes:
- Clear browser cache completely
- Use incognito mode
- Try different browser
- Check Odoo logs for authentication errors:
bash
sudo tail -f /var/log/odoo/odoo-server.log
🚀 Did This Solve Your
Problem?
If this answer helped you save time, money, or
frustration, consider:
✅ Upvoting (👍)
to help others find it faster
✅ Marking
as "Best Answer" if it resolved your issue
Your feedback keeps the Odoo community strong! 💪
(Need further customization? Drop a comment—I’m happy to
refine the solution!)