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"]: