mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-18 17:15:04 +00:00
fix: performance of the reposting
(cherry picked from commit 1bcfad8eb1)
This commit is contained in:
committed by
Mergify
parent
f2c556a6cc
commit
8d734df63b
@@ -718,6 +718,13 @@ class update_entries_after:
|
|||||||
{"item_code": self.item_code, "warehouse": self.args.warehouse}
|
{"item_code": self.item_code, "warehouse": self.args.warehouse}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
key = (self.item_code, self.args.warehouse)
|
||||||
|
if key in self.distinct_item_warehouses and self.distinct_item_warehouses[key].get(
|
||||||
|
"transfer_entry_to_repost"
|
||||||
|
):
|
||||||
|
# only repost stock entries
|
||||||
|
args["filter_voucher_type"] = "Stock Entry"
|
||||||
|
|
||||||
return list(self.get_sle_after_datetime(args))
|
return list(self.get_sle_after_datetime(args))
|
||||||
|
|
||||||
def get_dependent_entries_to_fix(self, entries_to_fix, sle):
|
def get_dependent_entries_to_fix(self, entries_to_fix, sle):
|
||||||
@@ -751,8 +758,10 @@ class update_entries_after:
|
|||||||
if getdate(existing_sle.get("posting_date")) > getdate(dependant_sle.posting_date):
|
if getdate(existing_sle.get("posting_date")) > getdate(dependant_sle.posting_date):
|
||||||
self.distinct_item_warehouses[key] = val
|
self.distinct_item_warehouses[key] = val
|
||||||
self.new_items_found = True
|
self.new_items_found = True
|
||||||
elif dependant_sle.voucher_type == "Stock Entry" and is_transfer_stock_entry(
|
elif (
|
||||||
dependant_sle.voucher_no
|
dependant_sle.actual_qty > 0
|
||||||
|
and dependant_sle.voucher_type == "Stock Entry"
|
||||||
|
and is_transfer_stock_entry(dependant_sle.voucher_no)
|
||||||
):
|
):
|
||||||
if self.distinct_item_warehouses[key].get("transfer_entry_to_repost"):
|
if self.distinct_item_warehouses[key].get("transfer_entry_to_repost"):
|
||||||
return
|
return
|
||||||
@@ -1839,6 +1848,9 @@ def get_stock_ledger_entries(
|
|||||||
if operator in (">", "<=") and previous_sle.get("name"):
|
if operator in (">", "<=") and previous_sle.get("name"):
|
||||||
conditions += " and name!=%(name)s"
|
conditions += " and name!=%(name)s"
|
||||||
|
|
||||||
|
if previous_sle.get("filter_voucher_type"):
|
||||||
|
conditions += " and voucher_type = %(filter_voucher_type)s"
|
||||||
|
|
||||||
if extra_cond:
|
if extra_cond:
|
||||||
conditions += f"{extra_cond}"
|
conditions += f"{extra_cond}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user