fix: add a realtime publish to refresh the dashboard content
This commit is contained in:
parent
51228b5ee3
commit
cab5d22ef5
@ -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({
|
||||
|
@ -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)
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user