fix: Linter and minor code refactor

- Create an indexed map of stale packed items table to avoid loops to check if packed item row exists
- Reset packed items if row deletion takes place
- Renamed functions to self-explain them
- Split long function
- Reduce function calls inside function (makes it harder to follow through)
This commit is contained in:
marination
2022-01-25 23:52:52 +05:30
parent f8a5786542
commit 4c677eafe9
2 changed files with 103 additions and 90 deletions

View File

@@ -441,7 +441,7 @@ erpnext.buying.get_items_from_product_bundle = function(frm) {
type: "GET",
method: "erpnext.stock.doctype.packed_item.packed_item.get_items_from_product_bundle",
args: {
args: {
row: {
item_code: args.product_bundle,
quantity: args.quantity,
parenttype: frm.doc.doctype,