Friday, March 20, 2026
1 change · 18.0
Enhancements to existing features
This update simplifies how Odoo ranks leads based on confidence, making it easier for developers to customize the ranking without needing to overhaul the entire sorting process. By creating a dedicated helper function, this change reduces complexity and improves the maintainability of lead prioritization logic, particularly for merging leads.
Original PR description
The lead confidence ranking used by `_sort_by_confidence_level()` is currently defined inline in the sorting method itself. This makes implementation-specific customizations harder than necessary, as custom modules need to override the whole method even when they only want to adjust the ranking criteria. Extracting the sort key computation into a dedicated helper keeps the default behavior unchanged while providing a smaller and clearer extension point for deployment customizations. This reduces override complexity and makes future adaptations of lead merge priority easier to implement and maintain. Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr