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
closesodoo/odoo#46741
X-original-commit: 5f28d1865aa6b4e204e052bf43ecfbfe7d45252b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>