Merge branch 'master' of github.com:webnotes/erpnext into custom_script_defer
diff --git a/accounts/doctype/account/account.js b/accounts/doctype/account/account.js
index 9a8115e..eb8e765 100644
--- a/accounts/doctype/account/account.js
+++ b/accounts/doctype/account/account.js
@@ -104,7 +104,7 @@
// Convert group to ledger
// -----------------------------------------
cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) {
- $c_obj(cur_frm.get_doclist(),'convert_group_to_ledger','',function(r,rt) {
+ return $c_obj(cur_frm.get_doclist(),'convert_group_to_ledger','',function(r,rt) {
if(r.message == 1) {
cur_frm.refresh();
}
@@ -114,7 +114,7 @@
// Convert ledger to group
// -----------------------------------------
cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) {
- $c_obj(cur_frm.get_doclist(),'convert_ledger_to_group','',function(r,rt) {
+ return $c_obj(cur_frm.get_doclist(),'convert_ledger_to_group','',function(r,rt) {
if(r.message == 1) {
cur_frm.refresh();
}
diff --git a/accounts/doctype/budget_distribution/budget_distribution.js b/accounts/doctype/budget_distribution/budget_distribution.js
index 5abd525..29e5e33 100644
--- a/accounts/doctype/budget_distribution/budget_distribution.js
+++ b/accounts/doctype/budget_distribution/budget_distribution.js
@@ -20,7 +20,7 @@
refresh_field('budget_distribution_details');
}
- $c('runserverobj',args={'method' : 'get_months', 'docs' :
+ return $c('runserverobj',args={'method' : 'get_months', 'docs' :
wn.model.compress(make_doclist(doc.doctype, doc.name))},callback1);
}
}
diff --git a/accounts/doctype/c_form/c_form.js b/accounts/doctype/c_form/c_form.js
index 35656e9..0bc9ff1 100644
--- a/accounts/doctype/c_form/c_form.js
+++ b/accounts/doctype/c_form/c_form.js
@@ -34,5 +34,5 @@
cur_frm.cscript.invoice_no = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
- get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1);
+ return get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1);
}
\ No newline at end of file
diff --git a/accounts/doctype/cost_center/cost_center.js b/accounts/doctype/cost_center/cost_center.js
index 96af1cf..7dc4223 100644
--- a/accounts/doctype/cost_center/cost_center.js
+++ b/accounts/doctype/cost_center/cost_center.js
@@ -84,7 +84,7 @@
}
cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) {
- $c_obj(cur_frm.get_doclist(),'convert_group_to_ledger','',function(r,rt) {
+ return $c_obj(cur_frm.get_doclist(),'convert_group_to_ledger','',function(r,rt) {
if(r.message == 1) {
cur_frm.refresh();
}
@@ -92,7 +92,7 @@
}
cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) {
- $c_obj(cur_frm.get_doclist(),'convert_ledger_to_group','',function(r,rt) {
+ return $c_obj(cur_frm.get_doclist(),'convert_ledger_to_group','',function(r,rt) {
if(r.message == 1) {
cur_frm.refresh();
}
diff --git a/accounts/doctype/fiscal_year/fiscal_year.js b/accounts/doctype/fiscal_year/fiscal_year.js
index 6e0ed38..0f70cf5 100644
--- a/accounts/doctype/fiscal_year/fiscal_year.js
+++ b/accounts/doctype/fiscal_year/fiscal_year.js
@@ -24,7 +24,7 @@
}
cur_frm.cscript.set_as_default = function() {
- wn.call({
+ return wn.call({
doc: cur_frm.doc,
method: "set_as_default"
});
diff --git a/accounts/doctype/journal_voucher/journal_voucher.js b/accounts/doctype/journal_voucher/journal_voucher.js
index ab4b2b0..a7f5b16 100644
--- a/accounts/doctype/journal_voucher/journal_voucher.js
+++ b/accounts/doctype/journal_voucher/journal_voucher.js
@@ -108,7 +108,7 @@
var d = locals[cdt][cdn];
if (d.against_voucher && !flt(d.debit)) {
args = {'doctype': 'Purchase Invoice', 'docname': d.against_voucher }
- get_server_fields('get_outstanding',docstring(args),'entries',doc,cdt,cdn,1,function(r,rt) { cur_frm.cscript.update_totals(doc); });
+ return get_server_fields('get_outstanding',docstring(args),'entries',doc,cdt,cdn,1,function(r,rt) { cur_frm.cscript.update_totals(doc); });
}
}
@@ -116,7 +116,7 @@
var d = locals[cdt][cdn];
if (d.against_invoice && !flt(d.credit)) {
args = {'doctype': 'Sales Invoice', 'docname': d.against_invoice }
- get_server_fields('get_outstanding',docstring(args),'entries',doc,cdt,cdn,1,function(r,rt) { cur_frm.cscript.update_totals(doc); });
+ return get_server_fields('get_outstanding',docstring(args),'entries',doc,cdt,cdn,1,function(r,rt) { cur_frm.cscript.update_totals(doc); });
}
}
@@ -141,7 +141,7 @@
cur_frm.cscript.get_balance = function(doc,dt,dn) {
cur_frm.cscript.update_totals(doc);
- $c_obj(make_doclist(dt,dn), 'get_balance', '', function(r, rt){
+ return $c_obj(make_doclist(dt,dn), 'get_balance', '', function(r, rt){
cur_frm.refresh();
});
}
@@ -151,7 +151,7 @@
cur_frm.cscript.account = function(doc,dt,dn) {
var d = locals[dt][dn];
if(d.account) {
- wn.call({
+ return wn.call({
method: "accounts.utils.get_balance_on",
args: {account: d.account, date: doc.posting_date},
callback: function(r) {
@@ -193,7 +193,7 @@
}
if(in_list(["Bank Voucher", "Cash Voucher"], doc.voucher_type)) {
- wn.call({
+ return wn.call({
type: "GET",
method: "accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
args: {
@@ -207,7 +207,7 @@
}
})
} else if(doc.voucher_type=="Opening Entry") {
- wn.call({
+ return wn.call({
type:"GET",
method: "accounts.doctype.journal_voucher.journal_voucher.get_opening_accounts",
args: {
diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js
index 3230ecf..d8c8c81 100644
--- a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js
+++ b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js
@@ -49,11 +49,11 @@
}
cur_frm.cscript.voucher_no =function(doc, cdt, cdn) {
- get_server_fields('get_voucher_details', '', '', doc, cdt, cdn, 1)
+ return get_server_fields('get_voucher_details', '', '', doc, cdt, cdn, 1)
}
cur_frm.cscript.account = function(doc, cdt, cdn) {
- wn.call({
+ return wn.call({
doc: this.frm.doc,
method: "set_account_type",
callback: function(r) {
diff --git a/accounts/doctype/pos_setting/pos_setting.js b/accounts/doctype/pos_setting/pos_setting.js
index 653b631..c91e4ce 100755
--- a/accounts/doctype/pos_setting/pos_setting.js
+++ b/accounts/doctype/pos_setting/pos_setting.js
@@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
cur_frm.cscript.onload = function(doc,cdt,cdn){
- $c_obj(make_doclist(cdt,cdn),'get_series','',function(r,rt){
+ return $c_obj(make_doclist(cdt,cdn),'get_series','',function(r,rt){
if(r.message) set_field_options('naming_series', r.message);
});
diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.js b/accounts/doctype/purchase_invoice/purchase_invoice.js
index e73386f..e71a408 100644
--- a/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -118,7 +118,7 @@
}
cur_frm.cscript.make_bank_voucher = function() {
- wn.call({
+ return wn.call({
method: "accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
args: {
"company": cur_frm.doc.company,
diff --git a/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js b/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js
index ba1a06b..626171c 100644
--- a/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js
+++ b/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js
@@ -156,7 +156,7 @@
}
else if(d.account_head && d.charge_type) {
arg = "{'charge_type' : '" + d.charge_type + "', 'account_head' : '" + d.account_head + "'}";
- get_server_fields('get_rate', arg, 'purchase_tax_details', doc, cdt, cdn, 1);
+ return get_server_fields('get_rate', arg, 'purchase_tax_details', doc, cdt, cdn, 1);
}
refresh_field('account_head',d.name,'purchase_tax_details');
}
diff --git a/accounts/doctype/sales_invoice/sales_invoice.js b/accounts/doctype/sales_invoice/sales_invoice.js
index 99f596c..4eb68da 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/accounts/doctype/sales_invoice/sales_invoice.js
@@ -139,7 +139,7 @@
msgprint(wn._("Please specify Company to proceed"));
} else {
var me = this;
- this.frm.call({
+ return this.frm.call({
doc: me.frm.doc,
method: "set_missing_values",
});
@@ -222,7 +222,7 @@
cur_frm.cscript.mode_of_payment = function(doc) {
- cur_frm.call({
+ return cur_frm.call({
method: "get_bank_cash_account",
args: { mode_of_payment: doc.mode_of_payment }
});
@@ -248,7 +248,7 @@
}
cur_frm.cscript.make_bank_voucher = function() {
- wn.call({
+ return wn.call({
method: "accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
args: {
"company": cur_frm.doc.company,
diff --git a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
index eca6eae..df6aaa9 100644
--- a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
+++ b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
@@ -165,7 +165,7 @@
}
else if(d.account_head && d.charge_type) {
arg = "{'charge_type' : '" + d.charge_type +"', 'account_head' : '" + d.account_head + "'}";
- get_server_fields('get_rate', arg, 'other_charges', doc, cdt, cdn, 1);
+ return get_server_fields('get_rate', arg, 'other_charges', doc, cdt, cdn, 1);
}
refresh_field('account_head',d.name,'other_charges');
}
diff --git a/accounts/page/accounts_browser/accounts_browser.js b/accounts/page/accounts_browser/accounts_browser.js
index 30ed5b9..18d43ff 100644
--- a/accounts/page/accounts_browser/accounts_browser.js
+++ b/accounts/page/accounts_browser/accounts_browser.js
@@ -73,7 +73,7 @@
})
// load up companies
- wn.call({
+ return wn.call({
method:'accounts.page.accounts_browser.accounts_browser.get_companies',
callback: function(r) {
wrapper.$company_select.empty();
@@ -265,7 +265,7 @@
v.master_type = '';
v.company = me.company;
- wn.call({
+ return wn.call({
args: v,
method:'accounts.utils.add_ac',
callback: function(r) {
@@ -312,7 +312,7 @@
v.parent_cost_center = node.data('label');
v.company = me.company;
- wn.call({
+ return wn.call({
args: v,
method:'accounts.utils.add_cc',
callback: function(r) {
diff --git a/accounts/page/financial_statements/financial_statements.js b/accounts/page/financial_statements/financial_statements.js
index d562e32..0175da7 100644
--- a/accounts/page/financial_statements/financial_statements.js
+++ b/accounts/page/financial_statements/financial_statements.js
@@ -62,7 +62,7 @@
</div>').css({"min-height": "400px"});
// load companies
- $c_obj('MIS Control','get_comp','', function(r,rt) {
+ return $c_obj('MIS Control','get_comp','', function(r,rt) {
// company
erpnext.fs.stmt_company.$input.empty()
.add_options(['Select Company...'].concat(r.message.company));
@@ -86,7 +86,7 @@
year: erpnext.fs.stmt_fiscal_year.get_value()
}
- $c_obj('MIS Control', 'get_statement', docstring(arg), function(r,rt) {
+ return $c_obj('MIS Control', 'get_statement', docstring(arg), function(r,rt) {
var nl = r.message;
var t = $i('stmt_tree');
var stmt_type = erpnext.fs.stmt_type.get_value();
diff --git a/buying/doctype/purchase_common/purchase_common.js b/buying/doctype/purchase_common/purchase_common.js
index 87f79a0..dabfcd9 100644
--- a/buying/doctype/purchase_common/purchase_common.js
+++ b/buying/doctype/purchase_common/purchase_common.js
@@ -92,7 +92,7 @@
var me = this;
var price_list_name = this.frm.doc.price_list_name;
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "set_supplier_defaults",
freeze: true,
@@ -109,7 +109,7 @@
supplier_address: function() {
var me = this;
if (this.frm.doc.supplier) {
- wn.call({
+ return wn.call({
doc: this.frm.doc,
method: "set_supplier_address",
freeze: true,
@@ -134,7 +134,7 @@
item.item_code = null;
refresh_field("item_code", item.name, item.parentfield);
} else {
- this.frm.call({
+ return this.frm.call({
method: "buying.utils.get_item_details",
child: item,
args: {
@@ -200,7 +200,7 @@
var me = this;
var item = wn.model.get_doc(cdt, cdn);
if(item.item_code && item.uom) {
- this.frm.call({
+ return this.frm.call({
method: "buying.utils.get_conversion_factor",
child: item,
args: {
@@ -233,7 +233,7 @@
warehouse: function(doc, cdt, cdn) {
var item = wn.model.get_doc(cdt, cdn);
if(item.item_code && item.warehouse) {
- this.frm.call({
+ return this.frm.call({
method: "buying.utils.get_projected_qty",
child: item,
args: {
@@ -267,7 +267,7 @@
purchase_other_charges: function() {
var me = this;
if(this.frm.doc.purchase_other_charges) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "get_purchase_tax_details",
callback: function(r) {
diff --git a/buying/doctype/purchase_order/purchase_order.js b/buying/doctype/purchase_order/purchase_order.js
index 99149bc..360170a 100644
--- a/buying/doctype/purchase_order/purchase_order.js
+++ b/buying/doctype/purchase_order/purchase_order.js
@@ -140,7 +140,7 @@
}
cur_frm.cscript.get_last_purchase_rate = function(doc, cdt, cdn){
- $c_obj(make_doclist(doc.doctype, doc.name), 'get_last_purchase_rate', '', function(r, rt) {
+ return $c_obj(make_doclist(doc.doctype, doc.name), 'get_last_purchase_rate', '', function(r, rt) {
refresh_field(cur_frm.cscript.fname);
var doc = locals[cdt][cdn];
cur_frm.cscript.calc_amount( doc, 2);
@@ -152,7 +152,7 @@
var check = confirm("Do you really want to STOP " + doc.name);
if (check) {
- $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
+ return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
cur_frm.refresh();
});
}
@@ -163,7 +163,7 @@
var check = confirm("Do you really want to UNSTOP " + doc.name);
if (check) {
- $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
+ return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
cur_frm.refresh();
});
}
diff --git a/buying/doctype/quality_inspection/quality_inspection.js b/buying/doctype/quality_inspection/quality_inspection.js
index 995119c..7c93209 100644
--- a/buying/doctype/quality_inspection/quality_inspection.js
+++ b/buying/doctype/quality_inspection/quality_inspection.js
@@ -16,7 +16,7 @@
cur_frm.cscript.item_code = function(doc, cdt, cdn) {
if (doc.item_code)
- get_server_fields('get_purchase_receipt_item_details','','',doc,cdt,cdn,1);
+ return get_server_fields('get_purchase_receipt_item_details','','',doc,cdt,cdn,1);
}
cur_frm.cscript.inspection_type = function(doc, cdt, cdn) {
diff --git a/buying/doctype/supplier/supplier.js b/buying/doctype/supplier/supplier.js
index 5374d50..2aa9b5e 100644
--- a/buying/doctype/supplier/supplier.js
+++ b/buying/doctype/supplier/supplier.js
@@ -55,7 +55,7 @@
cur_frm.dashboard.add_doctype_badge("Purchase Receipt", "supplier");
cur_frm.dashboard.add_doctype_badge("Purchase Invoice", "supplier");
- wn.call({
+ return wn.call({
type: "GET",
method:"buying.doctype.supplier.supplier.get_dashboard_info",
args: {
diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js
index 423f76e..dcdbed9 100644
--- a/home/page/latest_updates/latest_updates.js
+++ b/home/page/latest_updates/latest_updates.js
@@ -9,7 +9,7 @@
parent.html('<div class="progress progress-striped active">\
<div class="progress-bar" style="width: 100%;"></div></div>')
- wn.call({
+ return wn.call({
method:"home.page.latest_updates.latest_updates.get",
callback: function(r) {
parent.empty();
diff --git a/hr/doctype/appraisal/appraisal.js b/hr/doctype/appraisal/appraisal.js
index 2289064..3ac62b1 100644
--- a/hr/doctype/appraisal/appraisal.js
+++ b/hr/doctype/appraisal/appraisal.js
@@ -44,7 +44,7 @@
}
cur_frm.cscript.calculate_total_score = function(doc,cdt,cdn){
- //get_server_fields('calculate_total','','',doc,cdt,cdn,1);
+ //return get_server_fields('calculate_total','','',doc,cdt,cdn,1);
var val = getchildren('Appraisal Goal', doc.name, 'appraisal_details', doc.doctype);
var total =0;
for(var i = 0; i<val.length; i++){
diff --git a/hr/doctype/employee/employee.js b/hr/doctype/employee/employee.js
index 398d8f8..5522ff2 100644
--- a/hr/doctype/employee/employee.js
+++ b/hr/doctype/employee/employee.js
@@ -40,7 +40,7 @@
setup_leave_approver_select: function() {
var me = this;
- this.frm.call({
+ return this.frm.call({
method:"hr.utils.get_leave_approver_list",
callback: function(r) {
me.frm.fields_dict.employee_leave_approvers.grid
@@ -53,7 +53,7 @@
},
date_of_birth: function() {
- cur_frm.call({
+ return cur_frm.call({
method: "get_retirement_date",
args: {date_of_birth: this.frm.doc.date_of_birth}
});
@@ -88,7 +88,7 @@
validate_salary_structure: function(btn, callback) {
var me = this;
- this.frm.call({
+ return this.frm.call({
btn: btn,
method: "webnotes.client.get_value",
args: {
diff --git a/hr/doctype/expense_claim/expense_claim.js b/hr/doctype/expense_claim/expense_claim.js
index ce3cbea..6b60607 100644
--- a/hr/doctype/expense_claim/expense_claim.js
+++ b/hr/doctype/expense_claim/expense_claim.js
@@ -19,7 +19,7 @@
erpnext.hr.ExpenseClaimController = wn.ui.form.Controller.extend({
make_bank_voucher: function() {
var me = this;
- wn.call({
+ return wn.call({
method: "accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
args: {
"company": cur_frm.doc.company,
@@ -64,7 +64,7 @@
cur_frm.cscript.clear_sanctioned(doc);
}
- cur_frm.call({
+ return cur_frm.call({
method:"hr.utils.get_expense_approver_list",
callback: function(r) {
cur_frm.set_df_property("exp_approver", "options", r.message);
diff --git a/hr/doctype/leave_allocation/leave_allocation.js b/hr/doctype/leave_allocation/leave_allocation.js
index 80445c1..a567275 100755
--- a/hr/doctype/leave_allocation/leave_allocation.js
+++ b/hr/doctype/leave_allocation/leave_allocation.js
@@ -72,7 +72,7 @@
// ---------------------------------
calculate_total_leaves_allocated = function(doc, dt, dn) {
if(cint(doc.carry_forward) == 1 && doc.leave_type && doc.fiscal_year && doc.employee){
- get_server_fields('get_carry_forwarded_leaves','','', doc, dt, dn, 1);
+ return get_server_fields('get_carry_forwarded_leaves','','', doc, dt, dn, 1);
}
else if(cint(doc.carry_forward) == 0){
set_multiple(dt,dn,{carry_forwarded_leaves : 0,total_leaves_allocated : flt(doc.new_leaves_allocated)});
diff --git a/hr/doctype/leave_application/leave_application.js b/hr/doctype/leave_application/leave_application.js
index 2715a6c..5d97f95 100755
--- a/hr/doctype/leave_application/leave_application.js
+++ b/hr/doctype/leave_application/leave_application.js
@@ -24,7 +24,7 @@
cur_frm.cscript.calculate_total_days(doc, dt, dn);
}
cur_frm.set_df_property("leave_approver", "options", "");
- cur_frm.call({
+ return cur_frm.call({
method:"hr.utils.get_leave_approver_list",
callback: function(r) {
cur_frm.set_df_property("leave_approver", "options", $.map(r.message,
@@ -105,7 +105,7 @@
cur_frm.cscript.get_leave_balance = function(doc, dt, dn) {
if(doc.docstatus==0 && doc.employee && doc.leave_type && doc.fiscal_year) {
- cur_frm.call({
+ return cur_frm.call({
method: "get_leave_balance",
args: {
employee: doc.employee,
@@ -121,7 +121,7 @@
if(cint(doc.half_day) == 1) set_multiple(dt,dn,{total_leave_days:0.5});
else{
// server call is done to include holidays in leave days calculations
- get_server_fields('get_total_leave_days', '', '', doc, dt, dn, 1);
+ return get_server_fields('get_total_leave_days', '', '', doc, dt, dn, 1);
}
}
}
diff --git a/hr/doctype/leave_control_panel/leave_control_panel.js b/hr/doctype/leave_control_panel/leave_control_panel.js
index f3a635c..88ea067 100644
--- a/hr/doctype/leave_control_panel/leave_control_panel.js
+++ b/hr/doctype/leave_control_panel/leave_control_panel.js
@@ -24,7 +24,7 @@
// Validation For To Date
// ================================================================================================
cur_frm.cscript.to_date = function(doc, cdt, cdn) {
- $c('runserverobj', args={'method':'to_date_validation','docs':wn.model.compress(make_doclist(doc.doctype, doc.name))},
+ return $c('runserverobj', args={'method':'to_date_validation','docs':wn.model.compress(make_doclist(doc.doctype, doc.name))},
function(r, rt) {
var doc = locals[cdt][cdn];
if (r.message) {
diff --git a/hr/doctype/salary_manager/salary_manager.js b/hr/doctype/salary_manager/salary_manager.js
index d6dcc5c..eb13e15 100644
--- a/hr/doctype/salary_manager/salary_manager.js
+++ b/hr/doctype/salary_manager/salary_manager.js
@@ -28,7 +28,7 @@
if (r.message)
display_activity_log(r.message);
}
- $c('runserverobj', args={'method':'create_sal_slip','docs':wn.model.compress(make_doclist (cdt, cdn))},callback);
+ return $c('runserverobj', args={'method':'create_sal_slip','docs':wn.model.compress(make_doclist (cdt, cdn))},callback);
}
@@ -42,7 +42,7 @@
if (r.message)
display_activity_log(r.message);
}
- $c('runserverobj', args={'method':'submit_salary_slip','docs':wn.model.compress(make_doclist (cdt, cdn))},callback);
+ return $c('runserverobj', args={'method':'submit_salary_slip','docs':wn.model.compress(make_doclist (cdt, cdn))},callback);
}
}
@@ -79,5 +79,5 @@
loaddoc('Journal Voucher', jv.name);
}
- $c_obj(make_doclist(dt,dn),'get_acc_details','',call_back);
+ return $c_obj(make_doclist(dt,dn),'get_acc_details','',call_back);
}
diff --git a/hr/doctype/salary_slip/salary_slip.js b/hr/doctype/salary_slip/salary_slip.js
index f6853fc..387b773 100644
--- a/hr/doctype/salary_slip/salary_slip.js
+++ b/hr/doctype/salary_slip/salary_slip.js
@@ -34,7 +34,7 @@
// Get leave details
//---------------------------------------------------------------------
cur_frm.cscript.fiscal_year = function(doc,dt,dn){
- $c_obj(make_doclist(doc.doctype,doc.name), 'get_emp_and_leave_details','',function(r, rt) {
+ return $c_obj(make_doclist(doc.doctype,doc.name), 'get_emp_and_leave_details','',function(r, rt) {
var doc = locals[dt][dn];
cur_frm.refresh();
calculate_all(doc, dt, dn);
@@ -45,7 +45,7 @@
cur_frm.cscript.leave_without_pay = function(doc,dt,dn){
if (doc.employee && doc.fiscal_year && doc.month) {
- $c_obj(make_doclist(doc.doctype,doc.name), 'get_leave_details',doc.leave_without_pay,function(r, rt) {
+ return $c_obj(make_doclist(doc.doctype,doc.name), 'get_leave_details',doc.leave_without_pay,function(r, rt) {
var doc = locals[dt][dn];
cur_frm.refresh();
calculate_all(doc, dt, dn);
diff --git a/hr/doctype/salary_structure/salary_structure.js b/hr/doctype/salary_structure/salary_structure.js
index 60c159d..6b98988 100644
--- a/hr/doctype/salary_structure/salary_structure.js
+++ b/hr/doctype/salary_structure/salary_structure.js
@@ -20,7 +20,7 @@
e_tbl = getchildren('Salary Structure Earning', doc.name, 'earning_details', doc.doctype);
d_tbl = getchildren('Salary Structure Deduction', doc.name, 'deduction_details', doc.doctype);
if (e_tbl.length == 0 && d_tbl.length == 0)
- $c_obj(make_doclist(doc.doctype,doc.name),'make_earn_ded_table','', function(r, rt) { refresh_many(['earning_details', 'deduction_details']);});
+ return $c_obj(make_doclist(doc.doctype,doc.name),'make_earn_ded_table','', function(r, rt) { refresh_many(['earning_details', 'deduction_details']);});
}
cur_frm.cscript.refresh = function(doc, dt, dn){
@@ -40,7 +40,7 @@
cur_frm.cscript.employee = function(doc, dt, dn){
if (doc.employee)
- get_server_fields('get_employee_details','','',doc,dt,dn);
+ return get_server_fields('get_employee_details','','',doc,dt,dn);
}
cur_frm.cscript.modified_value = function(doc, cdt, cdn){
diff --git a/manufacturing/doctype/bom/bom.js b/manufacturing/doctype/bom/bom.js
index 87bc4aa..6f1786f 100644
--- a/manufacturing/doctype/bom/bom.js
+++ b/manufacturing/doctype/bom/bom.js
@@ -27,7 +27,7 @@
}
cur_frm.cscript.update_cost = function() {
- wn.call({
+ return wn.call({
doc: cur_frm.doc,
method: "update_cost",
callback: function(r) {
@@ -106,7 +106,7 @@
var get_bom_material_detail= function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if (d.item_code) {
- wn.call({
+ return wn.call({
doc: cur_frm.doc,
method: "get_bom_material_detail",
args: {
diff --git a/manufacturing/doctype/production_order/production_order.js b/manufacturing/doctype/production_order/production_order.js
index 12f9490..bf4fd8e 100644
--- a/manufacturing/doctype/production_order/production_order.js
+++ b/manufacturing/doctype/production_order/production_order.js
@@ -52,7 +52,7 @@
}
cur_frm.cscript.production_item = function(doc) {
- cur_frm.call({
+ return cur_frm.call({
method: "get_item_details",
args: { item: doc.production_item }
});
@@ -62,7 +62,7 @@
var doc = cur_frm.doc;
var check = confirm("Do you really want to stop production order: " + doc.name);
if (check) {
- $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Stopped', function(r, rt) {cur_frm.refresh();});
+ return $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Stopped', function(r, rt) {cur_frm.refresh();});
}
}
@@ -70,7 +70,7 @@
var doc = cur_frm.doc;
var check = confirm("Do really want to unstop production order: " + doc.name);
if (check)
- $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Unstopped', function(r, rt) {cur_frm.refresh();});
+ return $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Unstopped', function(r, rt) {cur_frm.refresh();});
}
cur_frm.cscript['Transfer Raw Materials'] = function() {
diff --git a/manufacturing/doctype/production_planning_tool/production_planning_tool.js b/manufacturing/doctype/production_planning_tool/production_planning_tool.js
index 6cd643e..c18c84e 100644
--- a/manufacturing/doctype/production_planning_tool/production_planning_tool.js
+++ b/manufacturing/doctype/production_planning_tool/production_planning_tool.js
@@ -26,19 +26,19 @@
cur_frm.cscript.sales_order = function(doc,cdt,cdn) {
var d = locals[cdt][cdn];
if (d.sales_order) {
- get_server_fields('get_so_details', d.sales_order, 'pp_so_details', doc, cdt, cdn, 1);
+ return get_server_fields('get_so_details', d.sales_order, 'pp_so_details', doc, cdt, cdn, 1);
}
}
cur_frm.cscript.item_code = function(doc,cdt,cdn) {
var d = locals[cdt][cdn];
if (d.item_code) {
- get_server_fields('get_item_details', d.item_code, 'pp_details', doc, cdt, cdn, 1);
+ return get_server_fields('get_item_details', d.item_code, 'pp_details', doc, cdt, cdn, 1);
}
}
cur_frm.cscript.download_materials_required = function(doc, cdt, cdn) {
- $c_obj(make_doclist(cdt, cdn), 'validate_data', '', function(r, rt) {
+ return $c_obj(make_doclist(cdt, cdn), 'validate_data', '', function(r, rt) {
if (!r['exc'])
$c_obj_csv(make_doclist(cdt, cdn), 'download_raw_materials', '', '');
});
diff --git a/projects/doctype/task/task.js b/projects/doctype/task/task.js
index cb2c539..7ecb224 100644
--- a/projects/doctype/task/task.js
+++ b/projects/doctype/task/task.js
@@ -29,7 +29,7 @@
project: function() {
if(this.frm.doc.project) {
- get_server_fields('get_project_details', '','', this.frm.doc, this.frm.doc.doctype,
+ return get_server_fields('get_project_details', '','', this.frm.doc, this.frm.doc.doctype,
this.frm.doc.name, 1);
}
},
diff --git a/public/js/complete_setup.js b/public/js/complete_setup.js
index d66d09a..d18bc82 100644
--- a/public/js/complete_setup.js
+++ b/public/js/complete_setup.js
@@ -54,7 +54,7 @@
$('header').toggle(false); // hide toolbar
}
- wn.call({
+ return wn.call({
method:"webnotes.country_info.get_country_timezone_info",
callback: function(data) {
erpnext.country_info = data.message.country_info;
@@ -74,7 +74,7 @@
var data = d.get_values();
if(!data) return;
$(this).set_working();
- $c_obj('Setup Control','setup_account',data,function(r, rt){
+ return $c_obj('Setup Control','setup_account',data,function(r, rt){
$(this).done_working();
if(!r.exc) {
sys_defaults = r.message;
diff --git a/public/js/transaction.js b/public/js/transaction.js
index 7077e02..2062fe5 100644
--- a/public/js/transaction.js
+++ b/public/js/transaction.js
@@ -55,7 +55,7 @@
onload_post_render: function() {
if(this.frm.doc.__islocal && this.frm.doc.company) {
var me = this;
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "onload_post_render",
freeze: true,
@@ -116,7 +116,7 @@
price_list_name: function(buying_or_selling) {
var me = this;
if(this.frm.doc.price_list_name) {
- this.frm.call({
+ return this.frm.call({
method: "setup.utils.get_price_list_currency",
args: {
price_list_name: this.frm.doc.price_list_name,
@@ -557,7 +557,7 @@
get_terms: function() {
var me = this;
if(this.frm.doc.tc_name) {
- this.frm.call({
+ return this.frm.call({
method: "webnotes.client.get_value",
args: {
doctype: "Terms and Conditions",
diff --git a/public/js/website_utils.js b/public/js/website_utils.js
index 519d630..f034be2 100644
--- a/public/js/website_utils.js
+++ b/public/js/website_utils.js
@@ -5,7 +5,7 @@
// Add / update a new Lead / Communication
// subject, sender, description
erpnext.send_message = function(opts) {
- wn.call({
+ return wn.call({
type: "POST",
method: "website.helpers.contact.send_message",
args: opts,
@@ -202,7 +202,7 @@
}
window.location.href = "login";
} else {
- wn.call({
+ return wn.call({
type: "POST",
method: "website.helpers.cart.update_cart",
args: {
diff --git a/selling/doctype/customer/customer.js b/selling/doctype/customer/customer.js
index cd530a2..935afb0 100644
--- a/selling/doctype/customer/customer.js
+++ b/selling/doctype/customer/customer.js
@@ -66,7 +66,7 @@
cur_frm.dashboard.add_doctype_badge("Delivery Note", "customer");
cur_frm.dashboard.add_doctype_badge("Sales Invoice", "customer");
- wn.call({
+ return wn.call({
type: "GET",
method:"selling.doctype.customer.customer.get_dashboard_info",
args: {
diff --git a/selling/doctype/installation_note/installation_note.js b/selling/doctype/installation_note/installation_note.js
index 5ad698a..b6f094f 100644
--- a/selling/doctype/installation_note/installation_note.js
+++ b/selling/doctype/installation_note/installation_note.js
@@ -78,7 +78,7 @@
customer: function() {
var me = this;
if(this.frm.doc.customer) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "set_customer_defaults",
});
@@ -93,7 +93,7 @@
customer_address: function() {
var me = this;
if(this.frm.doc.customer) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
args: {
customer: this.frm.doc.customer,
diff --git a/selling/doctype/opportunity/opportunity.js b/selling/doctype/opportunity/opportunity.js
index 80e565a..81bc23c 100644
--- a/selling/doctype/opportunity/opportunity.js
+++ b/selling/doctype/opportunity/opportunity.js
@@ -86,7 +86,7 @@
customer: function() {
var me = this;
if(this.frm.doc.customer) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "set_customer_defaults",
});
@@ -140,7 +140,7 @@
cur_frm.cscript.item_code = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if (d.item_code) {
- get_server_fields('get_item_details',d.item_code, 'enquiry_details',doc, cdt,cdn,1);
+ return get_server_fields('get_item_details',d.item_code, 'enquiry_details',doc, cdt,cdn,1);
}
}
@@ -165,7 +165,7 @@
}
cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) {
- if(doc.customer) get_server_fields('get_customer_address', JSON.stringify({customer: doc.customer, address: doc.customer_address, contact: doc.contact_person}),'', doc, dt, dn, 1);
+ if(doc.customer) return get_server_fields('get_customer_address', JSON.stringify({customer: doc.customer, address: doc.customer_address, contact: doc.contact_person}),'', doc, dt, dn, 1);
}
cur_frm.cscript.lead = function(doc, cdt, cdn) {
@@ -195,7 +195,7 @@
dialog.fields_dict.update.$input.click(function() {
args = dialog.get_values();
if(!args) return;
- cur_frm.call({
+ return cur_frm.call({
doc: cur_frm.doc,
method: "declare_enquiry_lost",
args: args.reason,
diff --git a/selling/doctype/quotation/quotation.js b/selling/doctype/quotation/quotation.js
index af49bb3..93af7cd 100644
--- a/selling/doctype/quotation/quotation.js
+++ b/selling/doctype/quotation/quotation.js
@@ -114,7 +114,7 @@
cur_frm.cscript.lead = function(doc, cdt, cdn) {
if(doc.lead) {
- cur_frm.call({
+ return cur_frm.call({
doc: cur_frm.doc,
method: "set_lead_defaults",
callback: function(r) {
@@ -152,7 +152,7 @@
dialog.fields_dict.update.$input.click(function() {
args = dialog.get_values();
if(!args) return;
- cur_frm.call({
+ return cur_frm.call({
method: "declare_order_lost",
doc: cur_frm.doc,
args: args.reason,
diff --git a/selling/doctype/sales_bom/sales_bom.js b/selling/doctype/sales_bom/sales_bom.js
index 7d79340..b67050c 100644
--- a/selling/doctype/sales_bom/sales_bom.js
+++ b/selling/doctype/sales_bom/sales_bom.js
@@ -18,7 +18,7 @@
cur_frm.toggle_enable('new_item_code', doc.__islocal);
if(!doc.__islocal) {
cur_frm.add_custom_button("Check for Duplicates", function() {
- cur_frm.call_server('check_duplicate', 1)
+ return cur_frm.call_server('check_duplicate', 1)
}, 'icon-search')
}
}
@@ -34,6 +34,6 @@
cur_frm.cscript.item_code = function(doc, dt, dn) {
var d = locals[dt][dn];
if (d.item_code){
- get_server_fields('get_item_details', d.item_code, 'sales_bom_items', doc ,dt, dn, 1);
+ return get_server_fields('get_item_details', d.item_code, 'sales_bom_items', doc ,dt, dn, 1);
}
}
\ No newline at end of file
diff --git a/selling/doctype/sales_common/sales_common.js b/selling/doctype/sales_common/sales_common.js
index d2461af..0f19fa2 100644
--- a/selling/doctype/sales_common/sales_common.js
+++ b/selling/doctype/sales_common/sales_common.js
@@ -135,7 +135,7 @@
msgprint(wn._("Please specify Company"));
} else {
var price_list_name = this.frm.doc.price_list_name;
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "set_customer_defaults",
freeze: true,
@@ -154,7 +154,7 @@
customer_address: function() {
var me = this;
if(this.frm.doc.customer) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
args: {
customer: this.frm.doc.customer,
@@ -183,7 +183,7 @@
item.item_code = null;
refresh_field("item_code", item.name, item.parentfield);
} else {
- this.frm.call({
+ return this.frm.call({
method: "selling.utils.get_item_details",
child: item,
args: {
@@ -292,7 +292,7 @@
warehouse: function(doc, cdt, cdn) {
var item = wn.model.get_doc(cdt, cdn);
if(item.item_code && item.warehouse) {
- this.frm.call({
+ return this.frm.call({
method: "selling.utils.get_available_qty",
child: item,
args: {
@@ -484,7 +484,7 @@
charge: function() {
var me = this;
if(this.frm.doc.charge) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "get_other_charges",
callback: function(r) {
@@ -499,7 +499,7 @@
shipping_rule: function() {
var me = this;
if(this.frm.doc.shipping_rule) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "apply_shipping_rule",
callback: function(r) {
diff --git a/selling/doctype/sales_order/sales_order.js b/selling/doctype/sales_order/sales_order.js
index 88442ea..8c1c2d2 100644
--- a/selling/doctype/sales_order/sales_order.js
+++ b/selling/doctype/sales_order/sales_order.js
@@ -101,7 +101,7 @@
reserved_warehouse: function(doc, cdt, cdn) {
var item = wn.model.get_doc(cdt, cdn);
if(item.item_code && item.reserved_warehouse) {
- this.frm.call({
+ return this.frm.call({
method: "selling.utils.get_available_qty",
child: item,
args: {
@@ -173,7 +173,7 @@
var check = confirm("Are you sure you want to STOP " + doc.name);
if (check) {
- $c('runserverobj', {
+ return $c('runserverobj', {
'method':'stop_sales_order',
'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))
}, function(r,rt) {
@@ -188,7 +188,7 @@
var check = confirm("Are you sure you want to UNSTOP " + doc.name);
if (check) {
- $c('runserverobj', {
+ return $c('runserverobj', {
'method':'unstop_sales_order',
'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))
}, function(r,rt) {
diff --git a/selling/page/sales_browser/sales_browser.js b/selling/page/sales_browser/sales_browser.js
index 8506bc6..a1578cf 100644
--- a/selling/page/sales_browser/sales_browser.js
+++ b/selling/page/sales_browser/sales_browser.js
@@ -33,7 +33,7 @@
wrapper.make_tree = function() {
var ctype = wn.get_route()[1] || 'Territory';
- wn.call({
+ return wn.call({
method: 'selling.page.sales_browser.sales_browser.get_children',
args: {ctype: ctype},
callback: function(r) {
@@ -155,7 +155,7 @@
v.parent = node.data('label');
v.ctype = me.ctype;
- wn.call({
+ return wn.call({
method: 'selling.page.sales_browser.sales_browser.add_node',
args: v,
callback: function() {
diff --git a/setup/doctype/backup_manager/backup_manager.js b/setup/doctype/backup_manager/backup_manager.js
index c78be3a..870922e 100644
--- a/setup/doctype/backup_manager/backup_manager.js
+++ b/setup/doctype/backup_manager/backup_manager.js
@@ -43,7 +43,7 @@
allow_dropbox_access: function() {
if(cur_frm.cscript.validate_send_notifications_to()) {
- wn.call({
+ return wn.call({
method: "setup.doctype.backup_manager.backup_dropbox.get_dropbox_authorize_url",
callback: function(r) {
if(!r.exc) {
@@ -60,7 +60,7 @@
allow_gdrive_access: function() {
if(cur_frm.cscript.validate_send_notifications_to()) {
- wn.call({
+ return wn.call({
method: "setup.doctype.backup_manager.backup_googledrive.get_gdrive_authorize_url",
callback: function(r) {
if(!r.exc) {
@@ -72,7 +72,7 @@
},
validate_gdrive: function() {
- wn.call({
+ return wn.call({
method: "setup.doctype.backup_manager.backup_googledrive.gdrive_callback",
args: {
verification_code: cur_frm.doc.verification_code
diff --git a/setup/doctype/contact_control/contact_control.js b/setup/doctype/contact_control/contact_control.js
index db0ed91..5c8e571 100755
--- a/setup/doctype/contact_control/contact_control.js
+++ b/setup/doctype/contact_control/contact_control.js
@@ -5,7 +5,7 @@
// get sates on country trigger
// -----------------------------
cur_frm.cscript.get_states=function(doc,dt,dn){
- $c('runserverobj', args={'method':'check_state', 'docs':wn.model.compress(make_doclist(doc.doctype, doc.name))},
+ return $c('runserverobj', args={'method':'check_state', 'docs':wn.model.compress(make_doclist(doc.doctype, doc.name))},
function(r,rt){
if(r.message) {
set_field_options('state', r.message);
@@ -152,7 +152,7 @@
}));
if (!go_ahead) return;
- wn.call({
+ return wn.call({
method: 'webnotes.model.delete_doc',
args: {
dt: doctype,
diff --git a/setup/doctype/email_digest/email_digest.js b/setup/doctype/email_digest/email_digest.js
index 5206842..011718f 100644
--- a/setup/doctype/email_digest/email_digest.js
+++ b/setup/doctype/email_digest/email_digest.js
@@ -22,7 +22,7 @@
cur_frm.add_custom_button('View Now', function() {
doc = locals[dt][dn];
if(doc.__unsaved != 1) {
- $c_obj(make_doclist(dt, dn), 'get_digest_msg', '', function(r, rt) {
+ return $c_obj(make_doclist(dt, dn), 'get_digest_msg', '', function(r, rt) {
if(r.exc) {
msgprint(err_msg);
console.log(r.exc);
@@ -45,7 +45,7 @@
cur_frm.add_custom_button('Send Now', function() {
doc = locals[dt][dn];
if(doc.__unsaved != 1) {
- $c_obj(make_doclist(dt, dn), 'send', '', function(r, rt) {
+ return $c_obj(make_doclist(dt, dn), 'send', '', function(r, rt) {
if(r.exc) {
msgprint(err_msg);
console.log(r.exc);
@@ -62,7 +62,7 @@
cur_frm.cscript.addremove_recipients = function(doc, dt, dn) {
// Get profile list
- $c_obj(make_doclist(dt, dn), 'get_profiles', '', function(r, rt) {
+ return $c_obj(make_doclist(dt, dn), 'get_profiles', '', function(r, rt) {
if(r.exc) {
msgprint(r.exc);
} else {
diff --git a/setup/doctype/global_defaults/global_defaults.js b/setup/doctype/global_defaults/global_defaults.js
index fa80025..f629ee0 100644
--- a/setup/doctype/global_defaults/global_defaults.js
+++ b/setup/doctype/global_defaults/global_defaults.js
@@ -16,7 +16,7 @@
// Validate
cur_frm.cscript.validate = function(doc, cdt, cdn) {
- $c_obj(make_doclist(cdt, cdn), 'get_defaults', '', function(r, rt){
+ return $c_obj(make_doclist(cdt, cdn), 'get_defaults', '', function(r, rt){
sys_defaults = r.message;
});
}
\ No newline at end of file
diff --git a/setup/doctype/naming_series/naming_series.js b/setup/doctype/naming_series/naming_series.js
index 07d6f82..663b08f 100644
--- a/setup/doctype/naming_series/naming_series.js
+++ b/setup/doctype/naming_series/naming_series.js
@@ -16,7 +16,7 @@
// Settings
cur_frm.cscript.onload_post_render = function(doc, cdt, cdn){
- cur_frm.call({
+ return cur_frm.call({
doc: cur_frm.doc,
method: 'get_transactions',
callback: function(r) {
@@ -45,15 +45,15 @@
}
if(doc.select_doc_for_series)
- $c_obj(make_doclist(doc.doctype, doc.name),'get_options','',callback)
+ return $c_obj(make_doclist(doc.doctype, doc.name),'get_options','',callback)
}
cur_frm.cscript.update = function() {
- cur_frm.call_server('update_series', '', cur_frm.cscript.update_selects)
+ return cur_frm.call_server('update_series', '', cur_frm.cscript.update_selects)
}
cur_frm.cscript.prefix = function(doc, dt, dn) {
- cur_frm.call_server('get_current', '', function(r) {
+ return cur_frm.call_server('get_current', '', function(r) {
refresh_field('current_value');
})
}
diff --git a/setup/doctype/notification_control/notification_control.js b/setup/doctype/notification_control/notification_control.js
index 619d417..279f5b4 100644
--- a/setup/doctype/notification_control/notification_control.js
+++ b/setup/doctype/notification_control/notification_control.js
@@ -21,6 +21,6 @@
doc.custom_message = r.message;
refresh_field('custom_message');
}
- $c_obj(make_doclist(cdt, cdn),'get_message',doc.select_transaction, callback)
+ return $c_obj(make_doclist(cdt, cdn),'get_message',doc.select_transaction, callback)
}
}
diff --git a/setup/page/setup/setup.js b/setup/page/setup/setup.js
index db752b1..ab640cf 100644
--- a/setup/page/setup/setup.js
+++ b/setup/page/setup/setup.js
@@ -23,7 +23,7 @@
body.html('<div class="progress progress-striped active">\
<div class="progress-bar" style="width: 100%;"></div></div>')
- wn.call({
+ return wn.call({
method: "setup.page.setup.setup.get",
callback: function(r) {
if(r.message) {
diff --git a/stock/doctype/delivery_note/delivery_note.js b/stock/doctype/delivery_note/delivery_note.js
index de6e9dc..88a9840 100644
--- a/stock/doctype/delivery_note/delivery_note.js
+++ b/stock/doctype/delivery_note/delivery_note.js
@@ -112,7 +112,7 @@
cur_frm.cscript.serial_no = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if (d.serial_no) {
- get_server_fields('get_serial_details',d.serial_no,'delivery_note_details',doc,cdt,cdn,1);
+ return get_server_fields('get_serial_details',d.serial_no,'delivery_note_details',doc,cdt,cdn,1);
}
}
diff --git a/stock/doctype/item/item.js b/stock/doctype/item/item.js
index 9af8331..a8401c4 100644
--- a/stock/doctype/item/item.js
+++ b/stock/doctype/item/item.js
@@ -51,7 +51,7 @@
var enabled = (r.message == 'exists') ? false : true;
cur_frm.toggle_enable(['has_serial_no', 'is_stock_item', 'valuation_method'], enabled);
}
- $c_obj(make_doclist(doc.doctype, doc.name),'check_if_sle_exists','',callback);
+ return $c_obj(make_doclist(doc.doctype, doc.name),'check_if_sle_exists','',callback);
}
}
@@ -130,7 +130,7 @@
cur_frm.cscript.tax_type = function(doc, cdt, cdn){
var d = locals[cdt][cdn];
- get_server_fields('get_tax_rate',d.tax_type,'item_tax',doc, cdt, cdn, 1);
+ return get_server_fields('get_tax_rate',d.tax_type,'item_tax',doc, cdt, cdn, 1);
}
diff --git a/stock/doctype/material_request/material_request.js b/stock/doctype/material_request/material_request.js
index bd5ab82..fe9af31 100644
--- a/stock/doctype/material_request/material_request.js
+++ b/stock/doctype/material_request/material_request.js
@@ -124,7 +124,7 @@
var check = confirm("Do you really want to STOP this Material Request?");
if (check) {
- $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
+ return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
cur_frm.refresh();
});
}
@@ -135,7 +135,7 @@
var check = confirm("Do you really want to UNSTOP this Material Request?");
if (check) {
- $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted','docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
+ return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted','docs': wn.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
cur_frm.refresh();
});
}
diff --git a/stock/doctype/packing_slip/packing_slip.js b/stock/doctype/packing_slip/packing_slip.js
index e19ab49..d86d64b 100644
--- a/stock/doctype/packing_slip/packing_slip.js
+++ b/stock/doctype/packing_slip/packing_slip.js
@@ -36,7 +36,7 @@
}
cur_frm.cscript.get_items = function(doc, cdt, cdn) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "get_items",
callback: function(r) {
diff --git a/stock/doctype/serial_no/serial_no.js b/stock/doctype/serial_no/serial_no.js
index 0253ffb..8e833d7 100644
--- a/stock/doctype/serial_no/serial_no.js
+++ b/stock/doctype/serial_no/serial_no.js
@@ -54,7 +54,7 @@
// Supplier
//-------------
cur_frm.cscript.supplier = function(doc,dt,dn) {
- if(doc.supplier) get_server_fields('get_default_supplier_address', JSON.stringify({supplier: doc.supplier}),'', doc, dt, dn, 1);
+ if(doc.supplier) return get_server_fields('get_default_supplier_address', JSON.stringify({supplier: doc.supplier}),'', doc, dt, dn, 1);
if(doc.supplier) unhide_field(['supplier_name','address_display']);
}
diff --git a/stock/doctype/stock_entry/stock_entry.js b/stock/doctype/stock_entry/stock_entry.js
index 7032f92..9e8c9a6 100644
--- a/stock/doctype/stock_entry/stock_entry.js
+++ b/stock/doctype/stock_entry/stock_entry.js
@@ -32,7 +32,7 @@
account_for = "stock_received_but_not_billed";
else account_for = "stock_adjustment_account";
- this.frm.call({
+ return this.frm.call({
method: "accounts.utils.get_company_default",
args: {
"fieldname": account_for,
@@ -142,7 +142,7 @@
},
get_items: function() {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "get_items",
callback: function(r) {
@@ -160,7 +160,7 @@
production_order: function() {
this.toggle_enable_bom();
- this.frm.call({
+ return this.frm.call({
method: "get_production_order_details",
args: {production_order: this.frm.doc.production_order}
});
@@ -212,7 +212,7 @@
make_return_jv: function() {
if(this.get_doctype_docname()) {
- this.frm.call({
+ return this.frm.call({
method: "make_return_jv",
args: {
stock_entry: this.frm.doc.name
@@ -269,23 +269,23 @@
}
cur_frm.cscript.delivery_note_no = function(doc,cdt,cdn){
- if(doc.delivery_note_no) get_server_fields('get_cust_values','','',doc,cdt,cdn,1);
+ if(doc.delivery_note_no) return get_server_fields('get_cust_values','','',doc,cdt,cdn,1);
}
cur_frm.cscript.sales_invoice_no = function(doc,cdt,cdn){
- if(doc.sales_invoice_no) get_server_fields('get_cust_values','','',doc,cdt,cdn,1);
+ if(doc.sales_invoice_no) return get_server_fields('get_cust_values','','',doc,cdt,cdn,1);
}
cur_frm.cscript.customer = function(doc,cdt,cdn){
- if(doc.customer) get_server_fields('get_cust_addr','','',doc,cdt,cdn,1);
+ if(doc.customer) return get_server_fields('get_cust_addr','','',doc,cdt,cdn,1);
}
cur_frm.cscript.purchase_receipt_no = function(doc,cdt,cdn){
- if(doc.purchase_receipt_no) get_server_fields('get_supp_values','','',doc,cdt,cdn,1);
+ if(doc.purchase_receipt_no) return get_server_fields('get_supp_values','','',doc,cdt,cdn,1);
}
cur_frm.cscript.supplier = function(doc,cdt,cdn){
- if(doc.supplier) get_server_fields('get_supp_addr','','',doc,cdt,cdn,1);
+ if(doc.supplier) return get_server_fields('get_supp_addr','','',doc,cdt,cdn,1);
}
@@ -328,7 +328,7 @@
'serial_no' : d.serial_no,
'bom_no' : d.bom_no
};
- get_server_fields('get_item_details',JSON.stringify(args),'mtn_details',doc,cdt,cdn,1);
+ return get_server_fields('get_item_details',JSON.stringify(args),'mtn_details',doc,cdt,cdn,1);
}
cur_frm.cscript.s_warehouse = function(doc, cdt, cdn) {
@@ -341,7 +341,7 @@
'bom_no' : d.bom_no,
'qty' : d.s_warehouse ? -1* d.qty : d.qty
}
- get_server_fields('get_warehouse_details', JSON.stringify(args),
+ return get_server_fields('get_warehouse_details', JSON.stringify(args),
'mtn_details', doc, cdt, cdn, 1);
}
@@ -351,7 +351,7 @@
var d = locals[cdt][cdn];
if(d.uom && d.item_code){
var arg = {'item_code':d.item_code, 'uom':d.uom, 'qty':d.qty}
- get_server_fields('get_uom_details',JSON.stringify(arg),'mtn_details', doc, cdt, cdn, 1);
+ return get_server_fields('get_uom_details',JSON.stringify(arg),'mtn_details', doc, cdt, cdn, 1);
}
}
diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.js b/stock/doctype/stock_reconciliation/stock_reconciliation.js
index 2e0efd8..501b5af 100644
--- a/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -26,7 +26,7 @@
var me = this;
if (sys_defaults.auto_inventory_accounting && !this.frm.doc.expense_account) {
- this.frm.call({
+ return this.frm.call({
method: "accounts.utils.get_company_default",
args: {
"fieldname": "stock_adjustment_account",
diff --git a/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.js b/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.js
index d736ff6..86f5bff 100644
--- a/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.js
+++ b/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.js
@@ -21,7 +21,7 @@
item_code: function() {
if(cur_frm.doc.item_code) {
- cur_frm.call({
+ return cur_frm.call({
method: "get_stock_uom",
args: { item_code: cur_frm.doc.item_code }
});
diff --git a/stock/doctype/warehouse/warehouse.js b/stock/doctype/warehouse/warehouse.js
index 0e9cd33..902f66f 100644
--- a/stock/doctype/warehouse/warehouse.js
+++ b/stock/doctype/warehouse/warehouse.js
@@ -26,6 +26,6 @@
var check = confirm("Are you sure you want to merge this warehouse into "
+ doc.merge_with + "?");
if (check) {
- $c_obj(make_doclist(cdt, cdn), 'merge_warehouses', '', '');
+ return $c_obj(make_doclist(cdt, cdn), 'merge_warehouses', '', '');
}
}
\ No newline at end of file
diff --git a/support/doctype/customer_issue/customer_issue.js b/support/doctype/customer_issue/customer_issue.js
index 3620c7e..4f45220 100644
--- a/support/doctype/customer_issue/customer_issue.js
+++ b/support/doctype/customer_issue/customer_issue.js
@@ -26,7 +26,7 @@
customer: function() {
var me = this;
if(this.frm.doc.customer) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "set_customer_defaults",
});
@@ -56,7 +56,7 @@
cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) {
if(doc.customer)
- get_server_fields('get_customer_address',
+ return get_server_fields('get_customer_address',
JSON.stringify({customer: doc.customer, address: doc.customer_address, contact: doc.contact_person}),'', doc, dt, dn, 1);
}
diff --git a/support/doctype/maintenance_schedule/maintenance_schedule.js b/support/doctype/maintenance_schedule/maintenance_schedule.js
index f8652d7..436caba 100644
--- a/support/doctype/maintenance_schedule/maintenance_schedule.js
+++ b/support/doctype/maintenance_schedule/maintenance_schedule.js
@@ -44,7 +44,7 @@
customer: function() {
var me = this;
if(this.frm.doc.customer) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "set_customer_defaults",
});
@@ -64,7 +64,7 @@
}
cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) {
- if(doc.customer) get_server_fields('get_customer_address', JSON.stringify({customer: doc.customer, address: doc.customer_address, contact: doc.contact_person}),'', doc, dt, dn, 1);
+ if(doc.customer) return get_server_fields('get_customer_address', JSON.stringify({customer: doc.customer, address: doc.customer_address, contact: doc.contact_person}),'', doc, dt, dn, 1);
}
cur_frm.fields_dict['customer_address'].get_query = function(doc, cdt, cdn) {
@@ -90,7 +90,7 @@
var fname = cur_frm.cscript.fname;
var d = locals[cdt][cdn];
if (d.item_code) {
- get_server_fields('get_item_details',d.item_code, 'item_maintenance_detail',doc,cdt,cdn,1);
+ return get_server_fields('get_item_details',d.item_code, 'item_maintenance_detail',doc,cdt,cdn,1);
}
}
@@ -101,7 +101,7 @@
arg.start_date = d.start_date;
arg.end_date = d.end_date;
arg.periodicity = d.periodicity;
- get_server_fields('get_no_of_visits',docstring(arg),'item_maintenance_detail',doc, cdt, cdn, 1);
+ return get_server_fields('get_no_of_visits',docstring(arg),'item_maintenance_detail',doc, cdt, cdn, 1);
}
else{
msgprint("Please enter Start Date and End Date");
@@ -110,7 +110,7 @@
cur_frm.cscript.generate_schedule = function(doc, cdt, cdn) {
if (!doc.__islocal) {
- $c('runserverobj', args={'method':'generate_schedule', 'docs':wn.model.compress(make_doclist(cdt,cdn))},
+ return $c('runserverobj', args={'method':'generate_schedule', 'docs':wn.model.compress(make_doclist(cdt,cdn))},
function(r,rt){
refresh_field('maintenance_schedule_detail');
}
diff --git a/support/doctype/maintenance_visit/maintenance_visit.js b/support/doctype/maintenance_visit/maintenance_visit.js
index 9f5fc5d..f4e4a35 100644
--- a/support/doctype/maintenance_visit/maintenance_visit.js
+++ b/support/doctype/maintenance_visit/maintenance_visit.js
@@ -62,7 +62,7 @@
customer: function() {
var me = this;
if(this.frm.doc.customer) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "set_customer_defaults",
});
@@ -86,7 +86,7 @@
}
cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) {
- if(doc.customer) get_server_fields('get_customer_address', JSON.stringify({customer: doc.customer, address: doc.customer_address, contact: doc.contact_person}),'', doc, dt, dn, 1);
+ if(doc.customer) return get_server_fields('get_customer_address', JSON.stringify({customer: doc.customer, address: doc.customer_address, contact: doc.contact_person}),'', doc, dt, dn, 1);
}
cur_frm.fields_dict['customer_address'].get_query = function(doc, cdt, cdn) {
@@ -111,7 +111,7 @@
var fname = cur_frm.cscript.fname;
var d = locals[cdt][cdn];
if (d.item_code) {
- get_server_fields('get_item_details',d.item_code, 'maintenance_visit_details',doc,cdt,cdn,1);
+ return get_server_fields('get_item_details',d.item_code, 'maintenance_visit_details',doc,cdt,cdn,1);
}
}
diff --git a/support/doctype/newsletter/newsletter.js b/support/doctype/newsletter/newsletter.js
index b7e24d2..5842acc 100644
--- a/support/doctype/newsletter/newsletter.js
+++ b/support/doctype/newsletter/newsletter.js
@@ -19,7 +19,7 @@
if(!doc.__islocal && !cint(doc.email_sent) && !doc.__unsaved
&& inList(wn.boot.profile.can_write, doc.doctype)) {
cur_frm.add_custom_button('Send', function() {
- $c_obj(make_doclist(doc.doctype, doc.name), 'send_emails', '', function(r) {
+ return $c_obj(make_doclist(doc.doctype, doc.name), 'send_emails', '', function(r) {
cur_frm.refresh();
});
})
@@ -30,7 +30,7 @@
repl("%(fullname)s <%(email)s>", wn.user_info(doc.owner)));
}
- wn.call({
+ return wn.call({
method: "support.doctype.newsletter.newsletter.get_lead_options",
type: "GET",
callback: function(r) {
diff --git a/support/doctype/support_ticket/support_ticket.js b/support/doctype/support_ticket/support_ticket.js
index d8cc798..34cc5ef 100644
--- a/support/doctype/support_ticket/support_ticket.js
+++ b/support/doctype/support_ticket/support_ticket.js
@@ -23,7 +23,7 @@
customer: function() {
var me = this;
if(this.frm.doc.customer) {
- this.frm.call({
+ return this.frm.call({
doc: this.frm.doc,
method: "set_customer_defaults",
});
@@ -93,7 +93,7 @@
},
set_status: function(status) {
- wn.call({
+ return wn.call({
method:"support.doctype.support_ticket.support_ticket.set_status",
args: {
name: cur_frm.doc.name,
diff --git a/utilities/doctype/rename_tool/rename_tool.js b/utilities/doctype/rename_tool/rename_tool.js
index 66a4399..bba7573 100644
--- a/utilities/doctype/rename_tool/rename_tool.js
+++ b/utilities/doctype/rename_tool/rename_tool.js
@@ -1,5 +1,5 @@
cur_frm.cscript.refresh = function(doc) {
- wn.call({
+ return wn.call({
method:"utilities.doctype.rename_tool.rename_tool.get_doctypes",
callback: function(r) {
cur_frm.set_df_property("select_doctype", "options", r.message);
diff --git a/utilities/doctype/sms_control/sms_control.js b/utilities/doctype/sms_control/sms_control.js
index e56315c..e6e14f7 100644
--- a/utilities/doctype/sms_control/sms_control.js
+++ b/utilities/doctype/sms_control/sms_control.js
@@ -17,7 +17,7 @@
function SMSManager() {
var me = this;
this.get_contact_number = function(contact, key, value) {
- $c_obj('SMS Control', 'get_contact_number', {
+ return $c_obj('SMS Control', 'get_contact_number', {
contact_name:contact,
value:value,
key:key
@@ -63,7 +63,7 @@
var v = me.dialog.get_values();
if(v) {
$(this).set_working();
- $c_obj('SMS Control', 'send_form_sms', v, function(r,rt) {
+ return $c_obj('SMS Control', 'send_form_sms', v, function(r,rt) {
$(this).done_working();
if(r.exc) {msgprint(r.exc); return; }
msgprint('Message Sent');
diff --git a/website/templates/js/cart.js b/website/templates/js/cart.js
index a22b9f3..ffa084a 100644
--- a/website/templates/js/cart.js
+++ b/website/templates/js/cart.js
@@ -18,7 +18,7 @@
$(document).ready(function() {
wn.cart.bind_events();
- wn.call({
+ return wn.call({
type: "POST",
method: "website.helpers.cart.get_cart_quotation",
callback: function(r) {
@@ -204,7 +204,7 @@
},
apply_shipping_rule: function(rule, btn) {
- wn.call({
+ return wn.call({
btn: btn,
type: "POST",
method: "website.helpers.cart.apply_shipping_rule",
@@ -257,7 +257,7 @@
}
});
- wn.call({
+ return wn.call({
type: "POST",
method: "website.helpers.cart.update_cart_address",
args: {
@@ -288,7 +288,7 @@
},
place_order: function() {
- wn.call({
+ return wn.call({
type: "POST",
method: "website.helpers.cart.place_order",
callback: function(r) {
diff --git a/website/templates/js/product_page.js b/website/templates/js/product_page.js
index adfeb5e..97d8f3d 100644
--- a/website/templates/js/product_page.js
+++ b/website/templates/js/product_page.js
@@ -18,7 +18,7 @@
var item_code = $('[itemscope] [itemprop="name"]').text().trim();
var qty = 0;
- wn.call({
+ return wn.call({
type: "POST",
method: "website.helpers.product.get_product_info",
args: {