Skip to content

Commit

Permalink
Merge pull request frappe#40039 from SherinKR/bank_account_validation
Browse files Browse the repository at this point in the history
fix: account validation error on bank account after editing existing bank account
  • Loading branch information
ruthra-kumar authored Feb 29, 2024
2 parents aeb555a + 8b3c809 commit fca70e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/bank_account/bank_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit fca70e3

Please sign in to comment.