fix: Re-open allows SO's to be over credit limit

(cherry picked from commit 5eed781263)
This commit is contained in:
ruthra kumar
2024-07-01 15:49:48 +05:30
committed by Mergify
parent 58e18e2b1f
commit 7fcb0f578a

View File

@@ -496,6 +496,10 @@ class SalesOrder(SellingController):
def update_status(self, status):
self.check_modified_date()
self.set_status(update=True, status=status)
# Upon Sales Order Re-open, check for credit limit.
# Limit should be checked after the 'Hold/Closed' status is reset.
if status == "Draft" and self.docstatus == 1:
self.check_credit_limit()
self.update_reserved_qty()
self.notify_update()
clear_doctype_notifications(self)