fix: add a realtime publish to refresh the dashboard content
diff --git a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js
index 7742a45..c24a104 100644
--- a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js
+++ b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js
@@ -6,6 +6,12 @@
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({
diff --git a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py
index 8fe1972..9d34a54 100644
--- a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py
+++ b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py
@@ -163,6 +163,7 @@
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)
diff --git a/erpnext/selling/page/point_of_sale/pos_payment.js b/erpnext/selling/page/point_of_sale/pos_payment.js
index b1f7de0..2053903 100644
--- a/erpnext/selling/page/point_of_sale/pos_payment.js
+++ b/erpnext/selling/page/point_of_sale/pos_payment.js
@@ -175,7 +175,6 @@
})
frappe.realtime.on("process_phone_payment", function(data) {
- console.log('within')
frappe.dom.unfreeze();
let message = data["ResultDesc"];
let title = __("Payment Failed");