fix: valiadte customer while pulling information

This commit is contained in:
Saurabh
2019-05-13 15:21:06 +05:30
parent 73c6d2e44c
commit 077e20f7ae
3 changed files with 11 additions and 1 deletions

View File

@@ -167,7 +167,12 @@ def get_pricing_rule_for_item(args):
if args.transaction_type=="selling":
if args.customer and not (args.customer_group and args.territory):
customer = frappe.get_cached_value("Customer", args.customer, ["customer_group", "territory"])
if args.quotation_to and args.quotation_to != 'Customer':
customer = frappe._dict()
else:
customer = frappe.get_cached_value("Customer", args.customer, ["customer_group", "territory"])
if customer:
args.customer_group, args.territory = customer

View File

@@ -429,6 +429,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
set_warehouse: me.frm.doc.set_warehouse,
warehouse: item.warehouse,
customer: me.frm.doc.customer || me.frm.doc.party_name,
quotation_to: me.frm.doc.quotation_to,
supplier: me.frm.doc.supplier,
currency: me.frm.doc.currency,
update_stock: update_stock,

View File

@@ -573,6 +573,10 @@ def validate_conversion_rate(args, meta):
def get_party_item_code(args, item_doc, out):
if args.transaction_type=="selling" and args.customer:
out.customer_item_code = None
if args.quotation_to != 'Customer':
return
customer_item_code = item_doc.get("customer_items", {"customer_name": args.customer})
if customer_item_code: