[fix] [minor] upload callback arguments changed
diff --git a/accounts/page/voucher_import_tool/voucher_import_tool.js b/accounts/page/voucher_import_tool/voucher_import_tool.js
index 48216b8..ffa230d 100644
--- a/accounts/page/voucher_import_tool/voucher_import_tool.js
+++ b/accounts/page/voucher_import_tool/voucher_import_tool.js
@@ -30,7 +30,7 @@
args: {
method: "accounts.page.voucher_import_tool.voucher_import_tool.upload"
},
- callback: function(r) {
+ callback: function(fid, filename, r) {
wrapper.waiting.toggle(false);
$(wrapper).find(".messages").toggle(true).html(
r.join("<div style='margin:4px; border-top:1px solid #aaa;'></div>"))
diff --git a/hr/doctype/upload_attendance/upload_attendance.js b/hr/doctype/upload_attendance/upload_attendance.js
index 4e5b47f..db97714 100644
--- a/hr/doctype/upload_attendance/upload_attendance.js
+++ b/hr/doctype/upload_attendance/upload_attendance.js
@@ -52,13 +52,13 @@
method: 'hr.doctype.upload_attendance.upload_attendance.upload'
},
sample_url: "e.g. http://example.com/somefile.csv",
- callback: function(r) {
+ callback: function(fid, filename, r) {
var $log_wrapper = $(cur_frm.fields_dict.import_log.wrapper).empty();
-
+
if(!r.messages) r.messages = [];
// replace links if error has occured
if(r.exc || r.error) {
- r.messages = $.map(r.messages, function(v) {
+ r.messages = $.map(r.message.messages, function(v) {
var msg = v.replace("Inserted", "Valid")
.replace("Updated", "Valid").split("<");
if (msg.length > 1) {
@@ -73,7 +73,7 @@
.concat(r.messages)
} else {
r.messages = ["<h4 style='color:green'>Import Successful!</h4>"].
- concat(r.messages)
+ concat(r.message.messages)
}
$.each(r.messages, function(i, v) {
diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.js b/stock/doctype/stock_reconciliation/stock_reconciliation.js
index b003e05..2e0efd8 100644
--- a/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -108,8 +108,8 @@
method: 'stock.doctype.stock_reconciliation.stock_reconciliation.upload'
},
sample_url: "e.g. http://example.com/somefile.csv",
- callback: function(r) {
- me.frm.set_value("reconciliation_json", JSON.stringify(r));
+ callback: function(fid, filename, r) {
+ me.frm.set_value("reconciliation_json", JSON.stringify(r.message));
me.show_reconciliation_data();
me.frm.save();
}
diff --git a/utilities/doctype/rename_tool/rename_tool.js b/utilities/doctype/rename_tool/rename_tool.js
index 9c93622..66a4399 100644
--- a/utilities/doctype/rename_tool/rename_tool.js
+++ b/utilities/doctype/rename_tool/rename_tool.js
@@ -28,9 +28,9 @@
select_doctype: cur_frm.doc.select_doctype
},
sample_url: "e.g. http://example.com/somefile.csv",
- callback: function(r) {
+ callback: function(fid, filename, r) {
$log.empty().html("<hr>");
- $.each(r, function(i, v) {
+ $.each(r.message, function(i, v) {
$("<div>" + v + "</div>").appendTo($log);
});
}