From c009450ef003cd9129383cd8e9b74bb693b1dcdf Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 26 Mar 2012 14:17:30 +0530 Subject: [PATCH] fix in item addition - details fetching --- .../accounts/doctype/receivable_voucher/receivable_voucher.py | 3 ++- erpnext/selling/doctype/quotation/quotation.py | 3 ++- erpnext/selling/doctype/sales_order/sales_order.py | 3 ++- erpnext/stock/doctype/delivery_note/delivery_note.py | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py index 446a116c99..b0d1e53d99 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py @@ -166,7 +166,8 @@ class DocType(TransactionBase): # Item Details # ------------- def get_item_details(self, args=None): - args = args and eval(args) or {} + import json + args = args and json.loads(args) or {} if args.get('item_code'): ret = get_obj('Sales Common').get_item_details(args, self) return self.get_pos_details(args, ret) diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 27206b2d49..f18546850c 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -77,7 +77,8 @@ class DocType(TransactionBase): # Get Item Details # ----------------- def get_item_details(self, args=None): - args = args and eval(args) or {} + import json + args = args and json.loads(args) or {} if args.get('item_code'): return get_obj('Sales Common').get_item_details(args, self) else: diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index c886ec38b6..7796e15cbd 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -102,7 +102,8 @@ class DocType(TransactionBase): # Get Item Details # ---------------- def get_item_details(self, args=None): - args = args and eval(args) or {} + import json + args = args and json.loads(args) or {} if args.get('item_code'): return get_obj('Sales Common').get_item_details(args, self) else: diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 3d8a1011fc..5940bb2284 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -107,7 +107,8 @@ class DocType(TransactionBase): # ***************** Get Item Details ****************************** def get_item_details(self, args=None): - args = args and eval(args) or {} + import json + args = args and json.loads(args) or {} if args.get('item_code'): return get_obj('Sales Common').get_item_details(args, self) else: