From 718ad3f24048b5acb32655a31a4965866cb429b0 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 26 May 2023 11:29:22 +0530 Subject: [PATCH] fix: travis --- erpnext/stock/stock_ledger.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 9f81a8cd3f..2f64eddb30 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -1066,15 +1066,15 @@ class update_entries_after(object): def update_bin_data(self, sle): bin_name = get_or_make_bin(sle.item_code, sle.warehouse) - frappe.db.set_value( - "Bin", - bin_name, - { - "actual_qty": sle.qty_after_transaction, - "valuation_rate": sle.valuation_rate, - "stock_value": sle.stock_value, - }, - ) + values_to_update = { + "actual_qty": sle.qty_after_transaction, + "stock_value": sle.stock_value, + } + + if sle.valuation_rate is not None: + values_to_update["valuation_rate"] = sle.valuation_rate + + frappe.db.set_value("Bin", bin_name, values_to_update) def update_bin(self): # update bin for each warehouse