diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 98837a86626..c6d2c9a8248 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1069,7 +1069,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe if (me.frm.doc.doctype == "Quotation" && me.frm.doc.quotation_to == "Customer") { (party_type = "Customer"), (party_name = me.frm.doc.party_name); } else { - party_type = frappe.meta.has_field(me.frm.doc.doctype, "customer") ? "Customer" : "Supplier"; + party_type = frappe.meta.has_field(me.frm.doc.doctype, "supplier") ? "Supplier" : "Customer"; party_name = me.frm.doc[party_type.toLowerCase()]; } if (party_name) {