fix: Missing if condition in Customer Default Bank Account Validation. (#20970)

This commit is contained in:
Marica
2020-03-18 11:29:02 +05:30
committed by GitHub
parent 7cf245895e
commit da7c6b0d99

View File

@@ -76,7 +76,8 @@ class Customer(TransactionBase):
def validate_default_bank_account(self):
if self.default_bank_account:
is_company_account = frappe.db.get_value('Bank Account', self.default_bank_account, 'is_company_account')
frappe.throw(_("{0} is not a company bank account").format(frappe.bold(self.default_bank_account)))
if not is_company_account:
frappe.throw(_("{0} is not a company bank account").format(frappe.bold(self.default_bank_account)))
def on_update(self):
self.validate_name_with_customer_group()