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

* fix: Better validation msg for difference account

* fix: Make primary info bold
This commit is contained in:
Deepesh Garg 2019-10-28 12:08:31 +05:30 committed by Anurag Mishra
parent 83b58352ce
commit 9942fcc8cb

View File

@ -241,7 +241,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)