Skip to content

Commit

Permalink
refactor: better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Jun 17, 2024
1 parent 107b614 commit 83ff94b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions erpnext/utilities/transaction_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@ def validate_currency_for_receivable_payable_and_advance_account(self):
):
frappe.throw(
_(
"{0} Account must be in either customer billing currency: {1} or Company default currency: {2}"
"{0} Account: {1} ({2}) must be in either customer billing currency: {3} or Company default currency: {4}"
).format(
account_type,
frappe.bold(x.account),
frappe.bold(receivable_payable_account_currency),
frappe.bold(self.default_currency),
frappe.bold(company_default_currency),
)
Expand All @@ -205,8 +207,12 @@ def validate_currency_for_receivable_payable_and_advance_account(self):
):
frappe.throw(
_(
"Advance Account must be in either customer billing currency: {0} or Company default currency: {1}"
).format(frappe.bold(self.default_currency), frappe.bold(company_default_currency))
"Advance Account: {0} must be in either customer billing currency: {1} or Company default currency: {2}"
).format(
frappe.bold(x.advance_account),
frappe.bold(self.default_currency),
frappe.bold(company_default_currency),
)
)

if (
Expand Down

0 comments on commit 83ff94b

Please sign in to comment.