From 14717eeac690ea241218b299ef4872dc48c792fd Mon Sep 17 00:00:00 2001 From: pateljannat Date: Tue, 9 Feb 2021 14:12:20 +0530 Subject: [PATCH] fix: better function name --- erpnext/controllers/stock_controller.py | 4 ++-- erpnext/stock/utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index d54a5366399..5370f4c571c 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -319,13 +319,13 @@ class StockController(AccountsController): return incoming_rate def validate_warehouse(self): - from erpnext.stock.utils import validate_warehouse_company, is_disabled_warehouse + from erpnext.stock.utils import validate_warehouse_company, validate_disabled_warehouse warehouses = list(set([d.warehouse for d in self.get("items") if getattr(d, "warehouse", None)])) for w in warehouses: - is_disabled_warehouse(w) + validate_disabled_warehouse(w) validate_warehouse_company(w, self.company) def update_billing_percentage(self, update_modified=True): diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 16e58356397..bef7450b7ef 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -279,7 +279,7 @@ def is_group_warehouse(warehouse): if frappe.db.get_value("Warehouse", warehouse, "is_group"): frappe.throw(_("Group node warehouse is not allowed to select for transactions")) -def is_disabled_warehouse(warehouse): +def validate_disabled_warehouse(warehouse): if frappe.db.get_value("Warehouse", warehouse, "disabled"): frappe.throw(_("Disabled Warehouse {0} cannot be used for this transaction.").format(get_link_to_form('Warehouse', warehouse)))