Wednesday, August 16, 2023
2 changes · master
Features or functions removed from Odoo
This change removes an old internal workaround that tracked the original user during elevated access. Because the platform now preserves the current user correctly, this cleanup simplifies related employee, portal, web editing, attachment, and user code without changing expected business behavior.
Original PR description
Formerly, using sudo() on a record had the effect of replacing the current user with the superuser. But sometimes, knowing who the "real user" was was necessary, so we needed to store it somewhere. This is basically why the key `binary_field_real_user` was introduced in the context: to keep track of who the user was before switching to sudo mode. Since 1e6c3bec2c5ca621344b09e58dbed535e80fb343, however, switching to sudo mode no longer changes the current user; meaning that the `binary_field_real_user` is no longer necessary. This commit removes the remaining occurrences of the now useless `binary_field_real_user` from the code. \* = hr, portal, web_editor Enterprise: https://github.com/odoo/enterprise/pull/27649
The Documents app no longer carries an old internal marker used to remember the original user during elevated access. This simplifies the code because the platform now keeps that user information automatically, with no expected change for everyday users.
Original PR description
Formerly, using sudo() on a record had the effect of replacing the current user with the superuser. But sometimes, knowing who the "real user" was was necessary, so we needed to store it somewhere. This is basically why the key `binary_field_real_user` was introduced in the context: to keep track of who the user was before switching to sudo mode. Since odoo/odoo@1e6c3be, however, switching to sudo mode no longer changes the current user; meaning that the `binary_field_real_user` is no longer necessary. This commit removes the remaining occurrences of the now useless `binary_field_real_user` from the code. Community: https://github.com/odoo/odoo/pull/92032