mirror of
https://github.com/frappe/erpnext.git
synced 2026-10-29 22:57:42 +00:00
fix(stock): check opening stock reconciliation per company
(cherry picked from commit 333273300a)
# Conflicts:
# erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
This commit is contained in:
@@ -1009,8 +1009,8 @@ class StockReconciliation(StockController):
|
||||
|
||||
if not self.expense_account:
|
||||
frappe.throw(_("Please enter Expense Account"))
|
||||
elif self.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.get_all(
|
||||
"Stock Ledger Entry", filters={"company": self.company, "is_cancelled": 0}, limit=1
|
||||
):
|
||||
if frappe.db.get_value("Account", self.expense_account, "report_type") == "Profit and Loss":
|
||||
frappe.throw(
|
||||
|
||||
Reference in New Issue
Block a user