Set status button in serial no

This commit is contained in:
Nabin Hait 2014-06-23 15:36:06 +05:30 committed by Anand Doshi
parent 838aeb149f
commit 43616619ec

View File

@ -17,4 +17,12 @@ cur_frm.cscript.onload = function() {
frappe.ui.form.on("Serial No", "refresh", function(frm) {
frm.toggle_enable("item_code", frm.doc.__islocal);
if(frm.doc.status == "Sales Returned" && frm.doc.warehouse)
cur_frm.add_custom_button(__('Set Status as Available'), cur_frm.cscript.set_status_as_available);
});
cur_frm.cscript.set_status_as_available = function() {
cur_frm.set_value("status", "Available");
cur_frm.save()
}