From c72dab49f4079c7bcf353b6db605247a0d83fd5f Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Sun, 23 Feb 2025 22:04:52 +0530 Subject: [PATCH] fix: valuation rate for batch (cherry picked from commit b88305a95f78ae6a02895dc289f2c9c9791c3651) --- erpnext/stock/deprecated_serial_batch.py | 2 ++ erpnext/stock/doctype/bin/bin.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/deprecated_serial_batch.py b/erpnext/stock/deprecated_serial_batch.py index 5ab862b51b3..f946f459c07 100644 --- a/erpnext/stock/deprecated_serial_batch.py +++ b/erpnext/stock/deprecated_serial_batch.py @@ -332,6 +332,8 @@ class DeprecatedBatchNoValuation: if self.sle.voucher_detail_no: query = query.where(sabb.voucher_detail_no != self.sle.voucher_detail_no) + query = query.where(sabb.voucher_type != "Pick List") + data = query.run(as_dict=True) if not data: return {} diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py index db5d1e58a84..d3de1897633 100644 --- a/erpnext/stock/doctype/bin/bin.py +++ b/erpnext/stock/doctype/bin/bin.py @@ -247,7 +247,7 @@ def update_qty(bin_name, args): & (sle.warehouse == args.get("warehouse")) & (sle.is_cancelled == 0) ) - .orderby(CombineDatetime(sle.posting_date, sle.posting_time), order=Order.desc) + .orderby(sle.posting_datetime, order=Order.desc) .orderby(sle.creation, order=Order.desc) .limit(1) .run()