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>
This commit is contained in:
Gursheen Kaur Anand
2023-12-02 19:53:00 +05:30
committed by GitHub
parent 5952cfa673
commit 9087e1443e
2 changed files with 17 additions and 0 deletions

View File

@@ -2958,6 +2958,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()