Merge pull request #43116 from frappe/mergify/bp/version-15-hotfix/pr-42816

fix: ensure `SellingController.onload` gets called for SO & DN (backport #42816)
This commit is contained in:
Smit Vora
2024-09-09 08:00:33 +05:30
committed by GitHub
2 changed files with 4 additions and 0 deletions

View File

@@ -185,6 +185,8 @@ class SalesOrder(SellingController):
super().__init__(*args, **kwargs)
def onload(self) -> None:
super().onload()
if frappe.db.get_single_value("Stock Settings", "enable_stock_reservation"):
if self.has_unreserved_stock():
self.set_onload("has_unreserved_stock", True)

View File

@@ -208,6 +208,8 @@ class DeliveryNote(SellingController):
)
def onload(self):
super().onload()
if self.docstatus == 0:
self.set_onload("has_unpacked_items", self.has_unpacked_items())