mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 20:49:19 +00:00
[fix] [client script] call cur_frm.cscript.custom_ type functions in the callback of standard functions
This commit is contained in:
@@ -27,7 +27,7 @@ cur_frm.cscript.refresh = function(doc,dt,dn){
|
||||
}
|
||||
|
||||
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 @@ cur_frm.cscript.is_default = function(doc) {
|
||||
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: {
|
||||
|
||||
@@ -52,7 +52,7 @@ var cfn_set_fields = function(doc, dt, dn) {
|
||||
}
|
||||
|
||||
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 @@ cur_frm.cscript['Stop Production Order'] = function() {
|
||||
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 @@ cur_frm.cscript['Unstop Production Order'] = function() {
|
||||
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() {
|
||||
|
||||
@@ -26,19 +26,19 @@ cur_frm.cscript.refresh = function(doc) {
|
||||
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', '', '');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user