Files
odoo_source/addons/product_margin
Andrea Grazioso (agr-odoo) 071b00f6a1 [FIX] product_margin: exclude accounting line from calculation
Install account_accountant,stock,purchase,sale_management
Activate 'Margin Analysis' in Accounting settings

Create a new product (on the category set FIFO and Automated Inventory
Valuation). Set $100 for the price and $60 for the cost,
update 2 quantity on hand.

Receive 1 more product via PO ($70 as the cost), and deliver 1 via
SO. With 2 quantity left (inventory value is $135 for 1 $60 and 1
$75) open Accounting>Reporting>Product Margins

The Avg. Sale Unit Price and #Invoiced in Sale are incorrect,
we only sold 1 item so far, but the report display 3.

This occur because accounting lines are kept into the calculation of the
sale line. Using 'exclude_from_invoice_tab' to filter out such lines fix the issue.

opw-2196625

closes odoo/odoo#46741

X-original-commit: 5f28d1865aa6b4e204e052bf43ecfbfe7d45252b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-03 12:18:51 +00:00
..
…