Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][FIX] database_cleanup: Prevent deletion of columns added in the init method of the model #2994

Merged
merged 1 commit into from
Jul 20, 2024

Commits on Jul 20, 2024

  1. [FIX] database_cleanup: Prevent deletion of columns added in the init…

    … method of the model
    
    With Odoo 16.0, running the "Purge columns" database cleanup, a field called totp_secret
    shows up for purging when the auth_totp module is installed. This field seems to be
    defined as a computed non-stored field
    (https://github.com/odoo/odoo/blob/93aa48c972889f941b97a60738d33f571204bb2c/addons/auth_totp/models/res_users.py#L24),
    but also has a query referring to it.
    (https://github.com/odoo/odoo/blob/93aa48c972889f941b97a60738d33f571204bb2c/addons/auth_totp/models/res_users.py#L160)
    
    The totp_secret field would have to be defined as stored=True, but it is not defined as such.
    Instead, it's added in res.users init method:
    https://github.com/odoo/odoo/blob/93aa48c972889f941b97a60738d33f571204bb2c/addons/auth_totp/models/res_users.py#L32
    
    The solution is to add the "totp_secret" field to the blacklisted fields of res.users.
    MrGigSolutions authored and pedrobaeza committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    246f3bb View commit details
    Browse the repository at this point in the history