fix: incorrect last sle for no batch wise valuation

This commit is contained in:
Rohit Waghchaure
2025-07-10 21:39:23 +05:30
parent 6e98adecdd
commit 93d3eb662f

View File

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