From 41c8cf645ae38e201646523a43aab5f38af426f9 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 8 Dec 2015 14:50:24 +0530 Subject: [PATCH] [fix] Get incoming rate if args as json --- erpnext/stock/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 0d95c58337..3f9de86493 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -92,6 +92,9 @@ def update_bin(args, allow_negative_stock=False, via_landed_cost_voucher=False): def get_incoming_rate(args): """Get Incoming Rate based on valuation method""" from erpnext.stock.stock_ledger import get_previous_sle + + if isinstance(args, basestring): + args = json.loads(args) in_rate = 0 if (args.get("serial_no") or "").strip():