-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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#71317 X-original-commit: 4d3147a Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com> Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
- Loading branch information
Showing
2 changed files
with
127 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters