[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#40093
Signed-off-by:
Nicolas Martinelli (nim) <nim@odoo.com>
Please register or sign in to comment