From 85fa3d2bb9b7690032c9ddf2b7021a47880f687a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 25 Jul 2013 16:02:15 +0530 Subject: [PATCH] [fix] [minor] upload callback arguments changed --- accounts/page/voucher_import_tool/voucher_import_tool.js | 2 +- hr/doctype/upload_attendance/upload_attendance.js | 8 ++++---- .../doctype/stock_reconciliation/stock_reconciliation.js | 4 ++-- utilities/doctype/rename_tool/rename_tool.js | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/accounts/page/voucher_import_tool/voucher_import_tool.js b/accounts/page/voucher_import_tool/voucher_import_tool.js index 48216b83ee..ffa230dd21 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 @@ wn.pages['voucher-import-tool'].onload = function(wrapper) { 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("
")) diff --git a/hr/doctype/upload_attendance/upload_attendance.js b/hr/doctype/upload_attendance/upload_attendance.js index 4e5b47fe00..db97714236 100644 --- a/hr/doctype/upload_attendance/upload_attendance.js +++ b/hr/doctype/upload_attendance/upload_attendance.js @@ -52,13 +52,13 @@ erpnext.hr.AttendanceControlPanel = wn.ui.form.Controller.extend({ 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 @@ erpnext.hr.AttendanceControlPanel = wn.ui.form.Controller.extend({ .concat(r.messages) } else { r.messages = ["

Import Successful!

"]. - 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 b003e05745..2e0efd8c2a 100644 --- a/stock/doctype/stock_reconciliation/stock_reconciliation.js +++ b/stock/doctype/stock_reconciliation/stock_reconciliation.js @@ -108,8 +108,8 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({ 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 9c93622185..66a4399ffd 100644 --- a/utilities/doctype/rename_tool/rename_tool.js +++ b/utilities/doctype/rename_tool/rename_tool.js @@ -28,9 +28,9 @@ cur_frm.cscript.setup_upload = function() { 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("
"); - $.each(r, function(i, v) { + $.each(r.message, function(i, v) { $("
" + v + "
").appendTo($log); }); }