Hello guys Why does erpnext not have a boolean field type? Incase let’s say i want to have a field which i can set True based on some condition also set false when that condition chnages even if the document has been submitted.
I tried using the check field but the problem is once it’s set to 1 or checked you cannot uncheck it later. I tried setting it’s value back to 0 as a way of unchecking but it’s not working, if there is a way to uncheck the check field please let me know.
The code
var get_undelivered_order = function (frm) {
var locations = frm.doc.locations;
locations.forEach(function(row){
frappe.call({
'method': 'custom_app.custom_scripts.pick_list.pick_list.get_undelivered_order',
'args': {
'item_code': row.item_code,
'warehouse': row.warehouse,
},
'callback': function(r){
$.each((r.message), function(i, d){
console.log(d.actual_qty - d.reserved_qty);
if ((d.actual_qty - d.reserved_qty) < 0) {
frm.doc.sal_flag_qty = 1;
frm.doc.sal__flagged_item = d.item_code;
console.log("Yessss");
}else{
frm.doc.sal_flag_qty = 0;
frm.doc.sal__flagged_item = '';
console.log("Noooooo");
}
})
}
});
});
console.log(frm.doc.sal__flagged_item);
console.log(frm.doc.sal_flag_qty);
}
Any help would be greatly appreciated.