Merge pull request #48527 from frappe/mergify/bp/version-15/pr-48525

fix: incorrect last sle for no batch wise valuation (backport #48512) (backport #48525)
This commit is contained in:
rohitwaghchaure
2025-07-11 15:23:58 +05:30
committed by GitHub

View File

@@ -284,6 +284,12 @@ class DeprecatedBatchNoValuation:
if self.sle.name:
query = query.where(sle.name != self.sle.name)
if self.sle.serial_and_batch_bundle:
query = query.where(
(sle.serial_and_batch_bundle != self.sle.serial_and_batch_bundle)
| (sle.serial_and_batch_bundle.isnull())
)
data = query.run(as_dict=True)
return data[0] if data else frappe._dict()