Tuesday, November 4, 2025
1 change · 18.0
Enhancements to existing features
This change prevents the built-in public user from being deleted, which could previously break the login page for anonymous visitors. It also ensures that existing databases missing this user can recover correctly when the Website module is installed, avoiding an internal server error and restoring access.
Original PR description
Steps to Reproduce: 1. Create a database without installing the Website module. 2. Navigate to archived users and delete the "Public User." 3. Attempt to log in to the database from another browser or incognito mode. 4. An internal server error occurs because the public user does not exist, making the login page inaccessible. Issue: Previously, it was possible to delete the public user, leading to an internal server error due to its absence, which prevented public access to the login page. Solution: - Implemented a restriction to prevent the deletion of the public user, similar to portal and default users. - Introduced a **pre_init_hook** to verify the existence of the public user in existing databases. If missing, the user is recreated during the Website module installation. - Added a test case to validate this functionality and ensure the public user cannot be deleted. task-4423568 Forward-Port-Of: odoo/odoo#196918