fix(stock): Grab posting date/time from SABB (backport #43493) (#43502)

fix(stock): Grab posting date/time from SABB (#43493)

(cherry picked from commit ade121dac6)

Co-authored-by: Corentin Forler <10946971+cogk@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2024-10-15 17:45:35 +05:30
committed by GitHub
parent aef544cd53
commit cd9f949b12

View File

@@ -1740,6 +1740,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"], as_dict=True
)
batch_obj = BatchNoValuation(
sle=frappe._dict(
{
@@ -1747,6 +1750,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,
}
)
)