An error occurred while fetching folder content.
Touati Djamel (otd)
authored
Steps to reproduce the bug: - Create a storable product “P1” - costing method: avco - Create a PO: - Add the product “P1”: - Line 1: Qty= 10, price= $50 - Line 2: Qty=1, price= $10 - Confirm the PO and receive the product - Go to purchase → Reporting → Purchase Analysis Problem: The average price is incorrect, the current calculation is: (50 + 10) / 2 = 30 The average should take into account the quantities purchased in each line, And not simply the number of line, so the correct calculation should be: ((10 * 50) + (10 * 1)) / 11 = 46.36 The SQL query is correct, it is when applying the read_group that the calculation is incorrect, we should override it to make a personalized calculation of the average. opw-3136406 closes odoo/odoo#110975 X-original-commit: 1369cd18 Signed-off-by:William Henrotin (whe) <whe@odoo.com> Signed-off-by:
Djamel Touati (otd) <otd@odoo.com>
Name | Last commit | Last update |
---|