-
- Downloads
[FIX] stock_account: fix computation of anglo saxon price unit
- Create a product with Category configured with:
* Costing Method: First In First Out (FIFO)
* Inventory Valuation: Automated
- Create a PO to buy 2 units at $100 (PO1) and receive the products
- Create a SO to sell 2 units (SO1) and deliver the products
=> COGS of SO1 should be $200 ($100 * 2)
- Return 1 unit from previous delivery
=> COGS of SO1 should be $100
- Create a SO to sell 1 unit (SO2) and deliver product
=> COGS of SO2 is $100
- Create a PO to buy 1 unit at $200 (PO2) and receive the product
- Re-deliver the returned unit from SO1
=> COGS of SO1 should be $300 ($100 + $200)
- Create invoice for SO1 and post it
The journal items (account.move.line) corresponding to the COGS have an incorrect
value: $200 ($100 + $100), instead of $300 ($100 + $200)
The issue comes from the method computing the anglo saxon price unit.
It does not take into account quantities from stock moves that have been returned.
This commit computes the number of units that have been returned for each stock
moves used to compute the anglo saxon price unit and to take the result into account
during the computation (of the anglo saxon price unit).
opw-2501260
closes odoo/odoo#69923
Signed-off-by:
William Henrotin <Whenrow@users.noreply.github.com>
Loading
Please register or sign in to comment