[FIX] sale: fix sales team goal not updated in CRM pipelines
Reproduce this issue - Install CRM & Sales - Create 2 sales team in CRM settings - Create some invoices and register payments for the 2 teams - Go in CRM > Sales > Team pipelines The invoicing amount is still 0 for both teams. Cause - The `_compute_invoiced` method in `CrmTeam` models use a SQL query to retrieve the invoices lines but it returns an empty recordset because the dates are not right ordered. - The line balance are negatives values, doing a SUM() will always returns 0 This commit re-order the dates and invert the sign of line.balance. OPW-2119819 closes odoo/odoo#40115 X-original-commit: 578dacc3 Signed-off-by:Jason Van Malder <jasonvanmalder@users.noreply.github.com>
Please register or sign in to comment