fix: update item details only in draft state

(cherry picked from commit 689172ff22)
This commit is contained in:
Kavin
2025-09-26 16:13:13 +05:30
committed by Mergify
parent 9e73d083b5
commit 30f6b53240

View File

@@ -74,8 +74,11 @@ class PickList(TransactionBase):
if self.has_reserved_stock():
self.set_onload("has_reserved_stock", True)
for item in self.get("locations"):
item.update(get_item_details(item.item_code, item.uom, item.warehouse, self.company))
if self.docstatus.is_draft() and not hasattr(self, "_action"):
company = self.company
for item in self.get("locations"):
item.update(get_item_details(item.item_code, item.uom, item.warehouse, company))
def validate(self):
self.validate_expired_batches()