-
- Downloads
[FIX] sale_mrp, sale_stock: compute is_reverse based on move type
Very similar to the usecase in commit dafe732e6874fbdd15dfd213b5c5c0cde93e534e
Steps to reproduce:
- Install Accounting, Sales, Stock
- Create a product category PC:
- Costing method: FIFO
- Inventory Valuation: Automated
- Create a product P:
- Type: Storable
- Product Category: PC
- Create a Sales Order SO with 1 x P at cost 10
- Confirm delivery
- SO > Create Invoice > Post
- SO > Return the delivery
- Change product price from 10 to 6
- SO > Create Invoice (!!)
- The invoice will be marked as a credit note automatically
- Post the invoice
Issue:
The product is listed in the journal items, which is correct,
but its value is 6 while it should be 10.
If we create the invoice from the Sales Order instead of adding a
credit note, then the move lines will not be considered reversed,
since they do not have an associated invoice.
Solution:
Consider the move type when deciding if the move line is reversed or not.
opw-3077772
closes odoo/odoo#111035
Signed-off-by:
Adrien Widart <awt@odoo.com>
Showing
- addons/sale_mrp/models/account_move.py 1 addition, 1 deletionaddons/sale_mrp/models/account_move.py
- addons/sale_mrp/tests/test_sale_mrp_flow.py 97 additions, 0 deletionsaddons/sale_mrp/tests/test_sale_mrp_flow.py
- addons/sale_stock/models/account_move.py 1 addition, 1 deletionaddons/sale_stock/models/account_move.py
- addons/sale_stock/tests/test_anglo_saxon_valuation.py 91 additions, 0 deletionsaddons/sale_stock/tests/test_anglo_saxon_valuation.py
Loading