mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
fix: maintain FIFO queue even if outgoing_rate is not found (#30563)
port of #30560
This commit is contained in:
@@ -866,16 +866,9 @@ class update_entries_after(object):
|
|||||||
index = i
|
index = i
|
||||||
break
|
break
|
||||||
|
|
||||||
# If no entry found with outgoing rate, collapse stack
|
# If no entry found with outgoing rate, consume as per FIFO
|
||||||
if index is None: # nosemgrep
|
if index is None: # nosemgrep
|
||||||
new_stock_value = (
|
index = 0
|
||||||
sum((d[0] * d[1] for d in self.wh_data.stock_queue)) - qty_to_pop * outgoing_rate
|
|
||||||
)
|
|
||||||
new_stock_qty = sum((d[0] for d in self.wh_data.stock_queue)) - qty_to_pop
|
|
||||||
self.wh_data.stock_queue = [
|
|
||||||
[new_stock_qty, new_stock_value / new_stock_qty if new_stock_qty > 0 else outgoing_rate]
|
|
||||||
]
|
|
||||||
break
|
|
||||||
else:
|
else:
|
||||||
index = 0
|
index = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user