diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js index cc19a110343..5e1bd8bc0f9 100644 --- a/erpnext/public/js/utils/party.js +++ b/erpnext/public/js/utils/party.js @@ -42,11 +42,15 @@ erpnext.utils.get_party_details = function(frm, method, args, callback) { callback: function(r) { if(r.message) { frm.updating_party_details = true; - frm.set_value(r.message); - frm.updating_party_details = false; - if(callback) callback(); - frm.refresh(); - erpnext.utils.add_item(frm); + frappe.run_serially([ + () => frm.set_value(r.message), + () => { + frm.updating_party_details = false; + if(callback) callback(); + frm.refresh(); + erpnext.utils.add_item(frm); + } + ]); } } }); diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index 6abe559c10f..6a84d0e09b5 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -89,7 +89,8 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ customer: function() { var me = this; - erpnext.utils.get_party_details(this.frm, null, null, function(){me.apply_pricing_rule()}); + erpnext.utils.get_party_details(this.frm, null, null, + function(){ me.apply_pricing_rule() }); }, customer_address: function() {