fix: SO ordered qty on PO item removal (#38378)

* fix: SO ordered qty on PO item removal (#38378)

* fix: update ordered_qty for SO when PO items removed

* refactor: use cached value

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 9087e1443e)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py

* chore: resolve conflicts

---------

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2023-12-04 09:35:51 +05:30
committed by GitHub
parent 8c9f4c8700
commit b7fe163de5
2 changed files with 17 additions and 0 deletions

View File

@@ -2874,6 +2874,9 @@ def validate_and_delete_children(parent, data) -> bool:
d.cancel()
d.delete()
if parent.doctype == "Purchase Order":
parent.update_ordered_qty_in_so_for_removed_items(deleted_children)
# need to update ordered qty in Material Request first
# bin uses Material Request Items to recalculate & update
parent.update_prevdoc_status()