-
- Downloads
[FIX] digest: fix wrong kpi_sale_total_value calculation
Before this commit, if two or more lines in sale_report had the same value as price_total, they were group together in _compute_kpi_sale_total_value and included in output sum only once. That leads to incorrect values in digest mail.
This commit fixes that issue by changing grouping column from price_total to company_id.
Steps to reproduce the issue:
----------------------------
1. Send Digest Mail for database and check values in it (assume we have both All Sales KPI and PoS KPI).
2. Create several sale_order_line and/or pos_order_line with exactly the same price_total (for example: 5 PoS transaction, each one for one product of value 10000).
2. Send Digest Mail again and check values in it.
Current behavior:
-----------------
The All Sales KPI will increase by value of only one of lines (in our example: PoS KPI will increase by 50000 = 5*10000, All Sales KPI will increase by 10000)
Expected behavior:
-----------------
All Sales KPI should include all transactions from sale_report in given period of time (all sale_order_line and pos_order_line).
opw-2938952
closes odoo/odoo#102677
Signed-off-by:
Victor Feyens (vfe) <vfe@odoo.com>