feat: Trigger rule application from client side
- Table is reset and overwritten with applied rules on checkbox trigger - Sider fixes
This commit is contained in:
@@ -516,27 +516,4 @@ erpnext.buying.get_items_from_product_bundle = function(frm) {
|
||||
});
|
||||
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
erpnext.apply_putaway_rule = (frm) => {
|
||||
if (!frm.doc.company) {
|
||||
frappe.throw({message:__("Please select a Company first."), title: __("Mandatory")})
|
||||
}
|
||||
if (!frm.doc.items.length) return;
|
||||
|
||||
frappe.call({
|
||||
method: "erpnext.stock.doctype.putaway_rule.putaway_rule.apply_putaway_rule",
|
||||
args: {
|
||||
items: frm.doc.items,
|
||||
company: frm.doc.company
|
||||
},
|
||||
callback: (result) => {
|
||||
if(!result.exc) {
|
||||
if(result.message) {
|
||||
frm.doc.items = result.message;
|
||||
frm.get_field("items").refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user