revert "fix: FIFO valuation in case of multi-item entries"
This reverts commit b8ee193d1a124668691b3d8181ce4e3bf612afe0. This is huge performance regression for large docs.
This commit is contained in:
parent
2f71c5bcca
commit
701878f60b
@ -448,8 +448,8 @@ class update_entries_after(object):
|
||||
return
|
||||
|
||||
# Get dynamic incoming/outgoing rate
|
||||
# XXX: performance regression
|
||||
self.get_dynamic_incoming_outgoing_rate(sle)
|
||||
if not self.args.get("sle_id"):
|
||||
self.get_dynamic_incoming_outgoing_rate(sle)
|
||||
|
||||
if get_serial_nos(sle.serial_no):
|
||||
self.get_serialized_values(sle)
|
||||
@ -492,8 +492,8 @@ class update_entries_after(object):
|
||||
sle.doctype="Stock Ledger Entry"
|
||||
frappe.get_doc(sle).db_update()
|
||||
|
||||
# XXX: performance regression
|
||||
self.update_outgoing_rate_on_transaction(sle)
|
||||
if not self.args.get("sle_id"):
|
||||
self.update_outgoing_rate_on_transaction(sle)
|
||||
|
||||
|
||||
def validate_negative_stock(self, sle):
|
||||
@ -576,8 +576,9 @@ class update_entries_after(object):
|
||||
def update_rate_on_stock_entry(self, sle, outgoing_rate):
|
||||
frappe.db.set_value("Stock Entry Detail", sle.voucher_detail_no, "basic_rate", outgoing_rate)
|
||||
|
||||
# XXX: performance regression
|
||||
self.recalculate_amounts_in_stock_entry(sle.voucher_no)
|
||||
# Update outgoing item's rate, recalculate FG Item's rate and total incoming/outgoing amount
|
||||
if not sle.dependant_sle_voucher_detail_no:
|
||||
self.recalculate_amounts_in_stock_entry(sle.voucher_no)
|
||||
|
||||
def recalculate_amounts_in_stock_entry(self, voucher_no):
|
||||
stock_entry = frappe.get_doc("Stock Entry", voucher_no, for_update=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user