fix: validate expense account for opening stock reco
This commit is contained in:
parent
5173170be3
commit
d8496a770a
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user