From b5a2a49940e933a3249cb5d83321e365631200a0 Mon Sep 17 00:00:00 2001 From: Corentin Forler Date: Thu, 3 Oct 2024 18:38:23 +0200 Subject: [PATCH] fix(stock): Grab posting date/time from SABB --- erpnext/stock/stock_ledger.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index be9f2a7994f..d0190ed7de9 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -1730,6 +1730,9 @@ def get_valuation_rate( # Get moving average rate of a specific batch number if warehouse and serial_and_batch_bundle: + sabb = frappe.db.get_value( + "Serial and Batch Bundle", serial_and_batch_bundle, ["posting_date", "posting_time"] + ) batch_obj = BatchNoValuation( sle=frappe._dict( { @@ -1737,6 +1740,8 @@ def get_valuation_rate( "warehouse": warehouse, "actual_qty": -1, "serial_and_batch_bundle": serial_and_batch_bundle, + "posting_date": sabb.posting_date, + "posting_time": sabb.posting_time, } ) ) -- GitLab