From e2ac705dceef43e6053ac66e3f40c2819d73fde3 Mon Sep 17 00:00:00 2001 From: Michael de Villiers Date: Mon, 10 Jan 2022 14:40:02 +0000 Subject: [PATCH] [FIX] stock_landed_cost: reconcillation with partial/zero journal items If a landed cost is validated for an invoice where items either have 1) a zero value, or 2) have been partially reconciled multiple times until it is fully reconciled, validation will fail with a cannot reconcile error because they are already reconciled. The fix is to use the `reconcilled` attribute rather than checking for existence of `full_reconcile_id`. X-original-commit: 608ed487b61c81e38a5d0b856732a8b94c6df64a Part-of: odoo/odoo#85621 --- addons/stock_landed_costs/models/stock_landed_cost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_landed_costs/models/stock_landed_cost.py b/addons/stock_landed_costs/models/stock_landed_cost.py index 520f739f2f8..0d67e5f5474 100644 --- a/addons/stock_landed_costs/models/stock_landed_cost.py +++ b/addons/stock_landed_costs/models/stock_landed_cost.py @@ -183,7 +183,7 @@ class StockLandedCost(models.Model): for product in cost.cost_lines.product_id: accounts = product.product_tmpl_id.get_product_accounts() input_account = accounts['stock_input'] - all_amls.filtered(lambda aml: aml.account_id == input_account and not aml.full_reconcile_id).reconcile() + all_amls.filtered(lambda aml: aml.account_id == input_account and not aml.reconciled).reconcile() return True