From 079d4e41649d6aa47ed3aa93007e0acac0635430 Mon Sep 17 00:00:00 2001 From: Gerlin Matos <60184389+G02-Manuel@users.noreply.github.com> Date: Wed, 28 May 2025 12:24:11 -0400 Subject: [PATCH] [FIX] Error when trying to add account to budget position --- base_account_budget/models/account_budget.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/base_account_budget/models/account_budget.py b/base_account_budget/models/account_budget.py index 0a41bd92b..dc42a305d 100644 --- a/base_account_budget/models/account_budget.py +++ b/base_account_budget/models/account_budget.py @@ -40,14 +40,13 @@ class AccountBudgetPost(models.Model): 'account.budget.post')) def _check_account_ids(self, vals): - for val in vals: - if 'account_ids' in val: - account_ids = val['account_ids'] - else: - account_ids = self.account_ids - if not account_ids: - raise ValidationError( - _('The budget must have at least one account.')) + if 'account_ids' in vals: + account_ids = vals['account_ids'] + else: + account_ids = self.account_ids + if not account_ids: + raise ValidationError( + _('The budget must have at least one account.')) @api.model_create_multi def create(self, vals):