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 cc9857affd
commit 952a7b46d5

View File

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