fix: add a realtime publish to refresh the dashboard content

This commit is contained in:
Mangesh-Khairnar 2020-10-16 11:38:07 +05:30
parent 51228b5ee3
commit cab5d22ef5
3 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,12 @@ frappe.ui.form.on('Mpesa Settings', {
frm.events.setup_account_balance_html(frm);
},
refresh: function(frm) {
frappe.realtime.on("refresh_mpesa_dashboard", function(){
frm.reload_doc();
});
},
get_account_balance: function(frm) {
if (!frm.initiator_name && !frm.security_credentials) return;
frappe.call({

View File

@ -163,6 +163,7 @@ def process_balance_info(**kwargs):
ref_doc.db_set("account_balance", balance_info)
request.handle_success(account_balance_response)
frappe.publish_realtime("refresh_mpesa_dashboard")
except:
request.handle_failure(account_balance_response)
frappe.log_error(title=_("Mpesa Account Balance Processing Error"), message=account_balance_response)

View File

@ -175,7 +175,6 @@ erpnext.PointOfSale.Payment = class {
})
frappe.realtime.on("process_phone_payment", function(data) {
console.log('within')
frappe.dom.unfreeze();
let message = data["ResultDesc"];
let title = __("Payment Failed");