refactor: better error messages

This commit is contained in:
ruthra kumar
2024-06-11 10:18:59 +05:30
parent 107b614518
commit 83ff94b9b8

View File

@@ -191,9 +191,11 @@ class TransactionBase(StatusUpdater):
): ):
frappe.throw( 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( ).format(
account_type, account_type,
frappe.bold(x.account),
frappe.bold(receivable_payable_account_currency),
frappe.bold(self.default_currency), frappe.bold(self.default_currency),
frappe.bold(company_default_currency), frappe.bold(company_default_currency),
) )
@@ -205,8 +207,12 @@ class TransactionBase(StatusUpdater):
): ):
frappe.throw( frappe.throw(
_( _(
"Advance Account must be in either customer billing currency: {0} or Company default currency: {1}" "Advance Account: {0} must be in either customer billing currency: {1} or Company default currency: {2}"
).format(frappe.bold(self.default_currency), frappe.bold(company_default_currency)) ).format(
frappe.bold(x.advance_account),
frappe.bold(self.default_currency),
frappe.bold(company_default_currency),
)
) )
if ( if (