Merge pull request #17581 from saurabh6790/quoation_creation_fix
fix: validate customer while pulling information
This commit is contained in:
@@ -167,7 +167,12 @@ def get_pricing_rule_for_item(args):
|
|||||||
|
|
||||||
if args.transaction_type=="selling":
|
if args.transaction_type=="selling":
|
||||||
if args.customer and not (args.customer_group and args.territory):
|
if args.customer and not (args.customer_group and args.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"])
|
customer = frappe.get_cached_value("Customer", args.customer, ["customer_group", "territory"])
|
||||||
|
|
||||||
if customer:
|
if customer:
|
||||||
args.customer_group, args.territory = customer
|
args.customer_group, args.territory = customer
|
||||||
|
|
||||||
|
|||||||
@@ -429,6 +429,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
set_warehouse: me.frm.doc.set_warehouse,
|
set_warehouse: me.frm.doc.set_warehouse,
|
||||||
warehouse: item.warehouse,
|
warehouse: item.warehouse,
|
||||||
customer: me.frm.doc.customer || me.frm.doc.party_name,
|
customer: me.frm.doc.customer || me.frm.doc.party_name,
|
||||||
|
quotation_to: me.frm.doc.quotation_to,
|
||||||
supplier: me.frm.doc.supplier,
|
supplier: me.frm.doc.supplier,
|
||||||
currency: me.frm.doc.currency,
|
currency: me.frm.doc.currency,
|
||||||
update_stock: update_stock,
|
update_stock: update_stock,
|
||||||
|
|||||||
@@ -573,6 +573,10 @@ def validate_conversion_rate(args, meta):
|
|||||||
def get_party_item_code(args, item_doc, out):
|
def get_party_item_code(args, item_doc, out):
|
||||||
if args.transaction_type=="selling" and args.customer:
|
if args.transaction_type=="selling" and args.customer:
|
||||||
out.customer_item_code = None
|
out.customer_item_code = None
|
||||||
|
|
||||||
|
if args.quotation_to != 'Customer':
|
||||||
|
return
|
||||||
|
|
||||||
customer_item_code = item_doc.get("customer_items", {"customer_name": args.customer})
|
customer_item_code = item_doc.get("customer_items", {"customer_name": args.customer})
|
||||||
|
|
||||||
if customer_item_code:
|
if customer_item_code:
|
||||||
|
|||||||
Reference in New Issue
Block a user