fix(report): Add column for Item Name (#15702)
This commit is contained in:
parent
ff0deedca9
commit
8e71074e1c
@ -13,12 +13,18 @@ def execute(filters=None):
|
||||
def get_columns():
|
||||
return [
|
||||
{
|
||||
"label": _("Item Name"),
|
||||
"fieldname": "item_name",
|
||||
"label": _("Item Code"),
|
||||
"fieldname": "item_code",
|
||||
"fieldtype": "Link",
|
||||
"options": "Item",
|
||||
"width": 120
|
||||
},
|
||||
{
|
||||
"label": _("Item Name"),
|
||||
"fieldname": "item_name",
|
||||
"fieldtype": "Data",
|
||||
"width": 120
|
||||
},
|
||||
{
|
||||
"label": _("Warehouse"),
|
||||
"fieldname": "warehouse",
|
||||
@ -70,7 +76,7 @@ def get_item_price_qty_data(filters):
|
||||
if filters.get("item_code"):
|
||||
conditions += "where a.item_code=%(item_code)s"
|
||||
|
||||
item_results = frappe.db.sql("""select a.item_code as item_name, a.name as price_list_name,
|
||||
item_results = frappe.db.sql("""select a.item_code, a.item_name, a.name as price_list_name,
|
||||
b.warehouse as warehouse, b.actual_qty as actual_qty
|
||||
from `tabItem Price` a left join `tabBin` b
|
||||
ON a.item_code = b.item_code
|
||||
@ -86,6 +92,7 @@ def get_item_price_qty_data(filters):
|
||||
if item_results:
|
||||
for item_dict in item_results:
|
||||
data = {
|
||||
'item_code': item_dict.item_code,
|
||||
'item_name': item_dict.item_name,
|
||||
'warehouse': item_dict.warehouse,
|
||||
'stock_available': item_dict.actual_qty or 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user