Skip to content

Commit

Permalink
perf: data import with 99 stock entries (#42685)
Browse files Browse the repository at this point in the history
perf: data import for stock entries
  • Loading branch information
rohitwaghchaure authored Aug 10, 2024
1 parent 2c69381 commit bf39e3a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions erpnext/stock/stock_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from frappe.model.meta import get_field_precision
from frappe.query_builder.functions import Sum
from frappe.utils import (
add_to_date,
cint,
cstr,
flt,
Expand Down Expand Up @@ -632,6 +633,7 @@ def process_sle_against_current_timestamp(self):

def get_sle_against_current_voucher(self):
self.args["posting_datetime"] = get_combine_datetime(self.args.posting_date, self.args.posting_time)
self.args["updated_creation_time"] = add_to_date(self.args.creation, seconds=-2)

return frappe.db.sql(
"""
Expand All @@ -646,6 +648,7 @@ def get_sle_against_current_voucher(self):
and (
posting_datetime = %(posting_datetime)s
)
and creation >= %(updated_creation_time)s
order by
creation ASC
for update
Expand Down

0 comments on commit bf39e3a

Please sign in to comment.