fix in fetch item details and supplier non-mandatory to fetch

This commit is contained in:
Nabin Hait 2014-02-20 11:27:47 +05:30
parent 33f36c3462
commit 0f2310690e
2 changed files with 5 additions and 3 deletions

View File

@ -503,7 +503,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
var me = this; var me = this;
var valid = true; 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(frappe.meta.has_field(me.frm.doc.doctype, fieldname)) {
if (!me.frm.doc[fieldname]) { if (!me.frm.doc[fieldname]) {
msgprint(frappe._("Please specify") + ": " + msgprint(frappe._("Please specify") + ": " +

View File

@ -5,6 +5,7 @@ from __future__ import unicode_literals
import frappe import frappe
from frappe import _, throw from frappe import _, throw
from frappe.utils import flt, cint, add_days from frappe.utils import flt, cint, add_days
from frappe.model.meta import has_field
import json import json
@frappe.whitelist() @frappe.whitelist()
@ -34,7 +35,8 @@ def get_item_details(args):
args = frappe._dict(args) args = frappe._dict(args)
if not args.get("transaction_type"): 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"): if not args.get("price_list"):
args.price_list = args.get("selling_price_list") or args.get("buying_price_list") args.price_list = args.get("selling_price_list") or args.get("buying_price_list")