[fix] [client script] call cur_frm.cscript.custom_ type functions in the callback of standard functions

This commit is contained in:
Anand Doshi
2013-07-29 19:30:39 +05:30
parent 17082e71f1
commit 1fac2a98cf
68 changed files with 154 additions and 154 deletions

View File

@@ -92,7 +92,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
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 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
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 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
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 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
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 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
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 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
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) {

View File

@@ -140,7 +140,7 @@ cur_frm.fields_dict['po_details'].grid.get_field('project_name').get_query = fun
}
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 @@ cur_frm.cscript['Stop Purchase Order'] = function() {
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 @@ cur_frm.cscript['Unstop Purchase Order'] = function() {
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();
});
}

View File

@@ -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) {

View File

@@ -55,7 +55,7 @@ cur_frm.cscript.make_dashboard = function(doc) {
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: {