From 9a0db392dee799cdb0e3691677703e3548fdd50d Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 14 Sep 2017 10:51:21 +0530 Subject: [PATCH] [Fix] Only typed keywords displying in the field on selection of customer (#10778) --- erpnext/accounts/page/pos/pos.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index f8399bf5181..0416b193d7a 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -260,9 +260,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ this.calculate_outstanding_amount(); } - if (this.frm.doc.customer) { - this.party_field.$input.val(this.frm.doc.customer); - } + this.set_customer_value_in_party_field(); if (!this.frm.doc.write_off_account) { this.frm.doc.write_off_account = doc.write_off_account @@ -273,6 +271,12 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ } }, + set_customer_value_in_party_field: function() { + if (this.frm.doc.customer) { + this.party_field.$input.val(this.frm.doc.customer); + } + }, + get_invoice_doc: function (si_docs) { var me = this; this.si_docs = this.get_doc_from_localstorage(); @@ -686,6 +690,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ set_focus: function () { if (this.default_customer || this.frm.doc.customer) { + this.set_customer_value_in_party_field(); this.serach_item.$input.focus(); } else { this.party_field.$input.focus();