[FIX] stock_account: reconcile same product only
-Create 3 products with different costing methods: AVCO, FIFO, Standard -Create a PO for the 3 items (same quantity and unit price in every line) -Receive -Create Vendor Bill -Check Journal items. You will notice that the AVCO product is marked as partially matched. Please keep in mind that this only happens when the 3 costings are used and the unit price is the same. It happes because `_get_all_related_aml` returns all the `account.move.line` for the journal entry and invoice. But not only for the current product. So if they share the same price unit then it could reconcile lines for different products. X-original-commit: 23ccf2c1bde84f03aaaedb206e37a35de701da5e Part-of: odoo/odoo#114987
This commit is contained in:
@@ -235,7 +235,8 @@ class AccountMove(models.Model):
|
||||
# Search for anglo-saxon lines linked to the product in the stock moves.
|
||||
product_stock_moves = stock_moves.filtered(lambda stock_move: stock_move.product_id == prod)
|
||||
product_account_moves |= product_stock_moves._get_all_related_aml().filtered(
|
||||
lambda line: line.account_id == product_interim_account and not line.reconciled and line.move_id.state == "posted"
|
||||
lambda line: line.account_id == product_interim_account and not line.reconciled and line.move_id.state == "posted" and
|
||||
line.product_id == prod
|
||||
)
|
||||
|
||||
# Reconcile.
|
||||
|
||||
Reference in New Issue
Block a user