From 8b3c809cb68ed9badb4d9fa4defc083b38bd4184 Mon Sep 17 00:00:00 2001 From: SherinKR Date: Thu, 22 Feb 2024 15:56:58 +0530 Subject: [PATCH] fix: account validation error on bank account after editing existing bank account --- erpnext/accounts/doctype/bank_account/bank_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/bank_account/bank_account.py b/erpnext/accounts/doctype/bank_account/bank_account.py index ece27e77ee97..ec3fa8312007 100644 --- a/erpnext/accounts/doctype/bank_account/bank_account.py +++ b/erpnext/accounts/doctype/bank_account/bank_account.py @@ -30,7 +30,7 @@ def validate(self): def validate_account(self): if self.account: - if accounts := frappe.db.get_all("Bank Account", filters={"account": self.account}, as_list=1): + if accounts := frappe.db.get_all("Bank Account", filters={"account": self.account, 'name':['!=', self.name]}, as_list=1): frappe.throw( _("'{0}' account is already used by {1}. Use another account.").format( frappe.bold(self.account),