fix: valuation rate for the legacy batches (backport #42011) (#42020)

fix: valuation rate for the legacy batches (#42011)

(cherry picked from commit 9ab333d105)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-06-25 13:07:03 +05:30
committed by GitHub
parent 838cc5b72a
commit f6be19cb7c
4 changed files with 63 additions and 41 deletions

View File

@@ -276,11 +276,7 @@ def get_incoming_rate(args, raise_error_if_no_rate=True):
sn_obj = SerialNoValuation(sle=args, warehouse=args.get("warehouse"), item_code=args.get("item_code"))
return sn_obj.get_incoming_rate()
elif (
args.get("batch_no")
and frappe.db.get_value("Batch", args.get("batch_no"), "use_batchwise_valuation", cache=True)
and not args.get("serial_and_batch_bundle")
):
elif args.get("batch_no") and not args.get("serial_and_batch_bundle"):
args.actual_qty = args.qty
args.batch_nos = frappe._dict({args.batch_no: args})