diff options
| author | Anh Thao Pham (pta) <pta@odoo.com> | 2021-04-27 08:32:22 +0000 |
|---|---|---|
| committer | Anh Thao Pham (pta) <pta@odoo.com> | 2021-05-27 09:46:47 +0000 |
| commit | 83136c8e7569636d38e12fc45f297e4d6f22ad36 (patch) | |
| tree | 7971768527ce52b04884f8004978e3db57e4e053 /odoo/modules | |
| parent | 9fc8511ad85c85d803503346fb0f0a39bb0e6b23 (diff) | |
[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#71317
X-original-commit: 4d3147a0b123ab591c1ca03a2ee86479992424d8
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Diffstat (limited to 'odoo/modules')
0 files changed, 0 insertions, 0 deletions
