Merge pull request #16725 from deepeshgarg007/item_dashboard

fix: Item name display issue fix in item dashboard
This commit is contained in:
Suraj Shetty 2019-02-21 14:42:38 +05:30 committed by GitHub
commit 463a3cf8cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,7 @@ def get_data(item_code=None, warehouse=None, item_group=None,
# user does not have access on warehouse
return []
return frappe.db.get_all('Bin', fields=['item_code', 'warehouse', 'projected_qty',
items = frappe.db.get_all('Bin', fields=['item_code', 'warehouse', 'projected_qty',
'reserved_qty', 'reserved_qty_for_production', 'reserved_qty_for_sub_contract', 'actual_qty', 'valuation_rate'],
or_filters={
'projected_qty': ['!=', 0],
@ -41,3 +41,10 @@ def get_data(item_code=None, warehouse=None, item_group=None,
order_by=sort_by + ' ' + sort_order,
limit_start=start,
limit_page_length='21')
for item in items:
item.update({
'item_name': frappe.get_cached_value("Item", item.item_code, 'item_name')
})
return items