perf: reduce number of queries for checking if future SL entry exists (#25064)
This commit is contained in:
@@ -207,11 +207,11 @@ class update_entries_after(object):
|
||||
|
||||
|
||||
def build(self):
|
||||
from erpnext.controllers.stock_controller import check_if_future_sle_exists
|
||||
from erpnext.controllers.stock_controller import future_sle_exists
|
||||
|
||||
if self.args.get("sle_id"):
|
||||
self.process_sle_against_current_timestamp()
|
||||
if not check_if_future_sle_exists(self.args):
|
||||
if not future_sle_exists(self.args):
|
||||
self.update_bin()
|
||||
else:
|
||||
entries_to_fix = self.get_future_entries_to_fix()
|
||||
@@ -856,4 +856,4 @@ def get_future_sle_with_negative_qty(args):
|
||||
and qty_after_transaction < 0
|
||||
order by timestamp(posting_date, posting_time) asc
|
||||
limit 1
|
||||
""", args, as_dict=1)
|
||||
""", args, as_dict=1)
|
||||
|
||||
Reference in New Issue
Block a user