mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-03 10:35:27 +00:00
perf: fix incorrect usage of get_cached_value
This commit is contained in:
@@ -154,7 +154,7 @@ def validate_expense_against_budget(args, expense_amount=0):
|
||||
"Company", args.get("company"), "exception_budget_approver_role"
|
||||
)
|
||||
|
||||
if not frappe.get_cached_value("Budget", {"fiscal_year": args.fiscal_year, "company": args.company}): # nosec
|
||||
if not frappe.db.get_value("Budget", {"fiscal_year": args.fiscal_year, "company": args.company}):
|
||||
return
|
||||
|
||||
if not args.account:
|
||||
|
||||
@@ -448,7 +448,7 @@ class TestInventoryDimension(IntegrationTestCase):
|
||||
self.assertEqual(d.store, "Inter Transfer Store 2")
|
||||
|
||||
def test_validate_negative_stock_for_inventory_dimension(self):
|
||||
get_inventory_dimensions.clear_cache()
|
||||
frappe.clear_cache(doctype="Inventory Dimension")
|
||||
item_code = "Test Negative Inventory Dimension Item"
|
||||
frappe.db.set_single_value("Stock Settings", "allow_negative_stock", 1)
|
||||
create_item(item_code)
|
||||
@@ -497,7 +497,7 @@ class TestInventoryDimension(IntegrationTestCase):
|
||||
# disable validate_negative_stock for inventory dimension
|
||||
inv_dimension.reload()
|
||||
inv_dimension.db_set("validate_negative_stock", 0)
|
||||
get_inventory_dimensions.clear_cache()
|
||||
frappe.clear_cache(doctype="Inventory Dimension")
|
||||
|
||||
# Try issuing 100 qty, more than available stock against inventory dimension
|
||||
doc = make_stock_entry(item_code=item_code, source=warehouse, qty=100, do_not_submit=True)
|
||||
|
||||
@@ -214,7 +214,7 @@ def get_bin(item_code, warehouse):
|
||||
|
||||
|
||||
def get_or_make_bin(item_code: str, warehouse: str) -> str:
|
||||
bin_record = frappe.get_cached_value("Bin", {"item_code": item_code, "warehouse": warehouse})
|
||||
bin_record = frappe.db.get_value("Bin", {"item_code": item_code, "warehouse": warehouse})
|
||||
|
||||
if not bin_record:
|
||||
bin_obj = _create_bin(item_code, warehouse)
|
||||
|
||||
Reference in New Issue
Block a user