mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-19 01:25:07 +00:00
fix: validate expense account for opening stock reco
This commit is contained in:
@@ -239,7 +239,7 @@ class StockReconciliation(StockController):
|
||||
|
||||
if not self.expense_account:
|
||||
frappe.throw(_("Please enter Expense Account"))
|
||||
elif self.reconciliation_purpose == "Opening Stock" or not frappe.db.sql("""select name from `tabStock Ledger Entry` limit 1"""):
|
||||
elif self.purpose == "Opening Stock" or not frappe.db.sql("""select name from `tabStock Ledger Entry` limit 1"""):
|
||||
if frappe.db.get_value("Account", self.expense_account, "report_type") == "Profit and Loss":
|
||||
frappe.throw(_("Difference Account must be a Asset/Liability type account, since this Stock Reconciliation is an Opening Entry"), OpeningEntryAccountError)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user