Friday, November 17, 2017
1 change
Code cleanup and technical improvements
This update streamlines how Odoo lists databases by directly finding databases owned by the current database user. It also adds clearer logging when something goes wrong, making support and troubleshooting easier without changing day-to-day user workflows.
Original PR description
Description of the issue/feature this PR addresses: When trying to list db's, the db_user is searched and verified before searching for the databases. As it's enclosed in a db.cursor context manager, we can assume that there is a db user at this very moment. This commit uses a single query to find databases that belongs to this cursor user (as suggested by @KangOl -- thanks) Finally, this is not the kind of PR that we can merge before the WE. Also, this commit adds a message in the logs when an exception occurs to facilitate debugging instead of silently returning an empty list. Current behavior before PR: Search for the current_user and verify that there is one and then search for his databases Desired behavior after PR is merged: Search directly for the databases of the current user -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr