From fad44a7951900889c26718394858c0c24d8ba1e3 Mon Sep 17 00:00:00 2001 From: Pani-k-folk Date: Fri, 20 Mar 2026 12:15:03 +0700 Subject: [PATCH] [FIX] budget_control_expense: uncommit only ml expense account --- budget_control_expense/models/account_move_line.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/budget_control_expense/models/account_move_line.py b/budget_control_expense/models/account_move_line.py index 44bc87bc..d4df22ce 100644 --- a/budget_control_expense/models/account_move_line.py +++ b/budget_control_expense/models/account_move_line.py @@ -23,6 +23,7 @@ def uncommit_expense_budget(self): """Uncommit the budget for related expenses when the vendor bill is in a valid state.""" Expense = self.env["hr.expense"] for ml in self: + account = ml.account_id inv_state = ml.move_id.state move_type = ml.move_id.move_type if move_type != "entry": @@ -30,7 +31,7 @@ def uncommit_expense_budget(self): if inv_state == "posted": expense = ml.expense_id.filtered("amount_commit") # Because this is not invoice, we need to compare account - if not expense: + if not expense or expense.account_id != account: continue # Also test for future advance extension, never uncommit for advance if hasattr(expense, "advance") and expense["advance"]: