Skip to content

Commit

Permalink
fix: close PO on SCO close (backport #38667) (#38681)
Browse files Browse the repository at this point in the history
fix: close PO on SCO close

(cherry picked from commit b023e5d)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
  • Loading branch information
mergify[bot] and s-aga-r authored Dec 12, 2023
1 parent fc79c6b commit 4055543
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from frappe.utils import flt

from erpnext.buying.doctype.purchase_order.purchase_order import is_subcontracting_order_created
from erpnext.buying.doctype.purchase_order.purchase_order import update_status as update_po_status
from erpnext.controllers.subcontracting_controller import SubcontractingController
from erpnext.stock.stock_balance import update_bin_qty
from erpnext.stock.utils import get_bin
Expand Down Expand Up @@ -308,6 +309,9 @@ def update_status(self, status=None, update_modified=True):
"Subcontracting Order", self.name, "status", status, update_modified=update_modified
)

if status == "Closed":
update_po_status("Closed", self.purchase_order)


@frappe.whitelist()
def make_subcontracting_receipt(source_name, target_doc=None):
Expand Down

0 comments on commit 4055543

Please sign in to comment.