fix: semgrep error

This commit is contained in:
Rohit Waghchaure 2021-06-01 11:24:01 +05:30
parent 7b7ceaadd9
commit 21b58ef045
3 changed files with 16 additions and 21 deletions

View File

@ -104,26 +104,26 @@ def get_columns():
"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 @@ def get_columns():
"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
},
}
]

View File

@ -101,9 +101,9 @@ class Subcontracting(object):
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 @@ class Subcontracting(object):
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:

View File

@ -1291,7 +1291,8 @@ class StockEntry(StockController):
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]