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:
marination
2020-12-08 19:11:51 +05:30
parent 0b68243979
commit 0f3cfc502b
9 changed files with 77 additions and 64 deletions

View File

@@ -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();
}
}
}
});
}