[Fix] Only typed keywords displying in the field on selection of customer (#10778)

This commit is contained in:
rohitwaghchaure 2017-09-14 10:51:21 +05:30 committed by Makarand Bauskar
parent 50312b54a0
commit 9a0db392de

View File

@ -260,9 +260,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.calculate_outstanding_amount(); this.calculate_outstanding_amount();
} }
if (this.frm.doc.customer) { this.set_customer_value_in_party_field();
this.party_field.$input.val(this.frm.doc.customer);
}
if (!this.frm.doc.write_off_account) { if (!this.frm.doc.write_off_account) {
this.frm.doc.write_off_account = 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) { get_invoice_doc: function (si_docs) {
var me = this; var me = this;
this.si_docs = this.get_doc_from_localstorage(); this.si_docs = this.get_doc_from_localstorage();
@ -686,6 +690,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
set_focus: function () { set_focus: function () {
if (this.default_customer || this.frm.doc.customer) { if (this.default_customer || this.frm.doc.customer) {
this.set_customer_value_in_party_field();
this.serach_item.$input.focus(); this.serach_item.$input.focus();
} else { } else {
this.party_field.$input.focus(); this.party_field.$input.focus();