fix(stock): update voucher valuaion rate in sle (backport #55960) (#56263)

fix(stock): update voucher valuaion rate in sle (#55960)

(cherry picked from commit 130c2594e1)

Co-authored-by: Sudharsanan Ashok <135326972+Sudharsanan11@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2026-06-21 16:41:05 +00:00
committed by GitHub
parent 6f9954bb62
commit 82e1221dc9

View File

@@ -916,6 +916,16 @@ class update_entries_after:
and not has_dimensions
):
# assert
if (
sle.voucher_detail_no
and self.repost_doc
and self.repost_doc.get("recalculate_valuation_rate")
):
source_rate = frappe.get_cached_value(
"Stock Reconciliation Item", sle.voucher_detail_no, "valuation_rate"
)
if source_rate:
sle.valuation_rate = source_rate
self.wh_data.valuation_rate = sle.valuation_rate
self.wh_data.qty_after_transaction = sle.qty_after_transaction
self.wh_data.stock_value = flt(self.wh_data.qty_after_transaction) * flt(