Thursday, November 13, 2025
1 change · 19.0
Enhancements to existing features
This change prevents the special Public User from being deleted, which avoids a site-wide login failure in databases that do not have the Website module installed. It also restores the user automatically when needed during Website installation, helping keep public access and the login page working reliably.
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#233328 Forward-Port-Of: odoo/odoo#196918