[fix] cleanup stop-resume code

This commit is contained in:
Rushabh Mehta
2015-11-03 18:20:39 +05:30
parent 7d23e4286e
commit 5951692db0
10 changed files with 100 additions and 134 deletions

View File

@@ -83,7 +83,7 @@ erpnext.production_order = {
frm.add_custom_button(__('Stop'), cur_frm.cscript['Stop Production Order'],
"icon-exclamation", "btn-default");
} else if (doc.status == 'Stopped') {
frm.add_custom_button(__('Unstop'), cur_frm.cscript['Unstop Production Order'],
frm.add_custom_button(__('Re-open'), cur_frm.cscript['Unstop Production Order'],
"icon-check", "btn-default");
}
@@ -239,18 +239,11 @@ $.extend(cur_frm.cscript, {
});
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) {
return $c_obj(doc, 'stop_unstop', 'Stopped', function(r, rt) {cur_frm.refresh();});
}
$c_obj(cur_frm.doc, 'stop_unstop', 'Stopped', function(r, rt) {cur_frm.refresh();});
}
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)
return $c_obj(doc, 'stop_unstop', 'Unstopped', function(r, rt) {cur_frm.refresh();});
$c_obj(cur_frm.doc, 'stop_unstop', 'Unstopped', function(r, rt) {cur_frm.refresh();});
}
cur_frm.cscript['Transfer Raw Materials'] = function() {