fix in fetch item details and supplier non-mandatory to fetch
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js
index 14d23d3..66cd501 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -503,7 +503,7 @@
var me = this;
var valid = true;
- $.each(["company", "customer", "supplier"], function(i, fieldname) {
+ $.each(["company", "customer"], function(i, fieldname) {
if(frappe.meta.has_field(me.frm.doc.doctype, fieldname)) {
if (!me.frm.doc[fieldname]) {
msgprint(frappe._("Please specify") + ": " +
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index f211cae..5680da8 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -5,6 +5,7 @@
import frappe
from frappe import _, throw
from frappe.utils import flt, cint, add_days
+from frappe.model.meta import has_field
import json
@frappe.whitelist()
@@ -32,9 +33,10 @@
if isinstance(args, basestring):
args = json.loads(args)
args = frappe._dict(args)
-
+
if not args.get("transaction_type"):
- args.transaction_type = "buying" if args.get("supplier") else "selling"
+ args.transaction_type = "buying" if has_field(args.get("doctype"), "supplier") \
+ else "selling"
if not args.get("price_list"):
args.price_list = args.get("selling_price_list") or args.get("buying_price_list")