Skip to content

Commit

Permalink
Merge pull request #29702 from frappe/mergify/bp/version-13-hotfix/pr…
Browse files Browse the repository at this point in the history
…-29699

chore: show credit/debit-to account in error message (backport #29699)
  • Loading branch information
nextchamp-saqib authored Feb 8, 2022
2 parents dddfab1 + 52a7492 commit 48a9d98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ def validate_credit_to_acc(self):

if self.supplier and account.account_type != "Payable":
frappe.throw(
_("Please ensure {} account is a Payable account. Change the account type to Payable or select a different account.")
.format(frappe.bold("Credit To")), title=_("Invalid Account")
_("Please ensure {} account {} is a Payable account. Change the account type to Payable or select a different account.")
.format(frappe.bold("Credit To"), frappe.bold(self.credit_to)), title=_("Invalid Account")
)

self.party_account_currency = account.account_currency
Expand Down
5 changes: 4 additions & 1 deletion erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,10 @@ def validate_debit_to_acc(self):
frappe.throw(msg, title=_("Invalid Account"))

if self.customer and account.account_type != "Receivable":
msg = _("Please ensure {} account is a Receivable account.").format(frappe.bold("Debit To")) + " "
msg = _("Please ensure {} account {} is a Receivable account.").format(
frappe.bold("Debit To"),
frappe.bold(self.debit_to)
) + " "
msg += _("Change the account type to Receivable or select a different account.")
frappe.throw(msg, title=_("Invalid Account"))

Expand Down

0 comments on commit 48a9d98

Please sign in to comment.