[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,12 +42,16 @@ 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);
frappe.run_serially([
() => frm.set_value(r.message),
() => {
frm.updating_party_details = false;
if(callback) callback();
frm.refresh();
erpnext.utils.add_item(frm);
}
]);
}
}
});
}

View File

@ -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() {