Negative stock allowed for perpetual inventory. Blocked in specific case
diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py
index ad553d8..a72a3d0 100644
--- a/erpnext/controllers/stock_controller.py
+++ b/erpnext/controllers/stock_controller.py
@@ -30,7 +30,7 @@
def get_gl_entries(self, warehouse_account=None, default_expense_account=None,
default_cost_center=None, allow_negative_stock=False):
- block_negative_stock(allow_negative_stock)
+ # block_negative_stock(allow_negative_stock)
if not warehouse_account:
warehouse_account = get_warehouse_account()
@@ -319,4 +319,7 @@
if not valuation_rate:
valuation_rate = frappe.db.get_value("Item Price", {"item_code": item_code, "buying": 1}, "price_list_rate")
+ if not valuation_rate:
+ frappe.throw(_("Purchase rate for item: {0} not found, which is required to book accounting entry. Please mention item price against a buying price list.").format(item_code))
+
return valuation_rate