fix: Better validation msg for difference account in Stock Entry (#19401)

* fix: Better validation msg for difference account

* fix: Make primary info bold
This commit is contained in:
Deepesh Garg
2019-10-28 12:07:57 +05:30
committed by Anurag Mishra
parent a1f5c22da7
commit 115887a886

View File

@@ -227,7 +227,9 @@ class StockEntry(StockController):
for d in self.get("items"):
if not d.expense_account:
frappe.throw(_("Please enter Difference Account"))
frappe.throw(_("Please enter <b>Difference Account</b> or set default <b>Stock Adjustment Account</b> for company {0}")
.format(frappe.bold(self.company)))
elif self.is_opening == "Yes" and frappe.db.get_value("Account", d.expense_account, "report_type") == "Profit and Loss":
frappe.throw(_("Difference Account must be a Asset/Liability type account, since this Stock Entry is an Opening Entry"), OpeningEntryAccountError)