Update accounts_controller.py
Updating Bin quantity based on doctype to optimize running efficiency.
This commit is contained in:
parent
c0ba6eafd5
commit
ba3578929e
@ -1362,8 +1362,13 @@ def validate_and_delete_children(parent, data):
|
||||
d.delete()
|
||||
|
||||
from erpnext.stock.stock_balance import update_bin_qty, get_reserved_qty, get_ordered_qty
|
||||
# updating both will be time consuming, update it based on the doctype. reserved qty if sales order, otherwise ordered qty
|
||||
if parent.doctype == "Sales Order":
|
||||
update_bin_qty(d.item_code, d.warehouse, {
|
||||
"reserved_qty": get_reserved_qty(d.item_code, d.warehouse)
|
||||
})
|
||||
else:
|
||||
update_bin_qty(d.item_code, d.warehouse, {
|
||||
"reserved_qty": get_reserved_qty(d.item_code, d.warehouse),
|
||||
"ordered_qty": get_ordered_qty(d.item_code, d.warehouse)
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user