Skip to content
Snippets Groups Projects
user avatar
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#110740

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
1369cd18
History

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials