fix: semgrep error
diff --git a/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.py b/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.py
index 8b08d2a..0b14e11 100644
--- a/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.py
+++ b/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.py
@@ -104,26 +104,26 @@
"fieldname": "item_code",
"fieldtype": "Link",
"options": "Item",
- "width": 140
+ "width": 160
},
{
- "label": _("Qty"),
+ "label": _("Order Qty"),
"fieldname": "qty",
"fieldtype": "Float",
- "width": 70
+ "width": 90
},
{
- "label": _("Received"),
+ "label": _("Received Qty"),
"fieldname": "received_qty",
"fieldtype": "Float",
- "width": 80
+ "width": 110
},
{
"label": _("Supplied Item"),
"fieldname": "rm_item_code",
"fieldtype": "Link",
"options": "Item",
- "width": 140
+ "width": 160
},
{
"label": _("Required Qty"),
@@ -138,21 +138,15 @@
"width": 110
},
{
- "label": _("Returned Qty"),
- "fieldname": "returned_qty",
- "fieldtype": "Float",
- "width": 110
- },
- {
- "label": _("Total Supplied"),
- "fieldname": "total_supplied_qty",
+ "label": _("Consumed Qty"),
+ "fieldname": "consumed_qty",
"fieldtype": "Float",
"width": 120
},
{
- "label": _("Consumed Qty"),
- "fieldname": "consumed_qty",
+ "label": _("Returned Qty"),
+ "fieldname": "returned_qty",
"fieldtype": "Float",
"width": 110
- },
+ }
]
\ No newline at end of file
diff --git a/erpnext/controllers/subcontracting.py b/erpnext/controllers/subcontracting.py
index fe77576..a9a38bd 100644
--- a/erpnext/controllers/subcontracting.py
+++ b/erpnext/controllers/subcontracting.py
@@ -101,9 +101,9 @@
self.set_alternative_item_details(row)
for doctype in ['Purchase Receipt', 'Purchase Invoice']:
- self.remove_consumed_materials(doctype)
+ self.update_consumed_materials(doctype)
- def remove_consumed_materials(self, doctype, return_consumed_items=False):
+ def update_consumed_materials(self, doctype, return_consumed_items=False):
'''Deduct the consumed materials from the available materials.'''
pr_items = self.get_received_items(doctype)
@@ -311,7 +311,7 @@
return
self.get_purchase_orders()
- consumed_items, pr_items = self.remove_consumed_materials(self.doctype, return_consumed_items=True)
+ consumed_items, pr_items = self.update_consumed_materials(self.doctype, return_consumed_items=True)
itemwise_consumed_qty = defaultdict(float)
for row in consumed_items:
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 2132808..0009926 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -1291,7 +1291,8 @@
item_dict[item]["qty"] = 0
# delete items with 0 qty
- for item in item_dict.keys():
+ list_of_items = item_dict.keys()
+ for item in list_of_items:
if not item_dict[item]["qty"]:
del item_dict[item]