[refactor] party.js get_party_details (#9888)

This commit is contained in:
Rushabh Mehta
2017-07-17 15:31:17 +05:30
committed by Makarand Bauskar
parent ea4497c8d2
commit dab1172a18
2 changed files with 11 additions and 6 deletions

View File

@@ -42,11 +42,15 @@ erpnext.utils.get_party_details = function(frm, method, args, callback) {
callback: function(r) { callback: function(r) {
if(r.message) { if(r.message) {
frm.updating_party_details = true; frm.updating_party_details = true;
frm.set_value(r.message); frappe.run_serially([
frm.updating_party_details = false; () => frm.set_value(r.message),
if(callback) callback(); () => {
frm.refresh(); frm.updating_party_details = false;
erpnext.utils.add_item(frm); if(callback) callback();
frm.refresh();
erpnext.utils.add_item(frm);
}
]);
} }
} }
}); });

View File

@@ -89,7 +89,8 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
customer: function() { customer: function() {
var me = this; 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() { customer_address: function() {