Skip to content

Commit

Permalink
fix: update qty on SCO status change
Browse files Browse the repository at this point in the history
  • Loading branch information
s-aga-r committed Jan 4, 2024
1 parent 0d01bd8 commit 245effc
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,10 @@ def validate(self):

def on_submit(self):
self.update_prevdoc_status()
self.update_requested_qty()
self.update_ordered_qty_for_subcontracting()
self.update_reserved_qty_for_subcontracting()
self.update_status()

def on_cancel(self):
self.update_prevdoc_status()
self.update_requested_qty()
self.update_ordered_qty_for_subcontracting()
self.update_reserved_qty_for_subcontracting()
self.update_status()

def validate_purchase_order_for_subcontracting(self):
Expand Down Expand Up @@ -305,9 +299,11 @@ def update_status(self, status=None, update_modified=True):
status = "Cancelled"

if status:
frappe.db.set_value(
"Subcontracting Order", self.name, "status", status, update_modified=update_modified
)
self.db_set("status", status, update_modified=update_modified)

self.update_requested_qty()
self.update_ordered_qty_for_subcontracting()
self.update_reserved_qty_for_subcontracting()


@frappe.whitelist()
Expand Down

0 comments on commit 245effc

Please sign in to comment.