fix: display generate txt on submission
diff --git a/erpnext/accounts/doctype/payment_order/regional/india.js b/erpnext/accounts/doctype/payment_order/regional/india.js
index 28d2a2a..2b49a06 100644
--- a/erpnext/accounts/doctype/payment_order/regional/india.js
+++ b/erpnext/accounts/doctype/payment_order/regional/india.js
@@ -1,6 +1,6 @@
frappe.ui.form.on('Payment Order', {
refresh: function(frm) {
- if (frm.doc.docstatus==1 && frm.doc.payment_order_type==='Payment Request') {
+ if (frm.doc.docstatus==1 && frm.doc.payment_order_type==='Payment Entry') {
frm.add_custom_button(__('Generate Text File'),
function() {
frm.trigger("generate_text_and_download_file");
@@ -15,7 +15,15 @@
},
freeze: true,
callback: function(r) {
- frm.refresh();
+ {
+ frm.refresh();
+ const a = document.createElement('a');
+ let file_obj = r.message;
+ a.href = file_obj.file_url;
+ a.target = '_blank';
+ a.download = file_obj.file_name;
+ a.click();
+ }
}
});
}