hello, i’m testing this report , i can do it as query builder but i’m trying it from python as well as a script report
when i navigate to this report i get this error message
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/selling/report/sales_report/sales_report.py”, line 14, in get_columns
“”“return columns”“”
NameError: global name ‘_’ is not defined
that’s the report code
from future import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns = get_columns()
sl_sales_entries = get_sales_entries(filters)
data = []
for sle in sl_sales_entries:
data.append([ sle.sales, sle.cust, sle.date, sle.totalht, sle.vat, sle.totalttc ])
return columns, data
def get_columns():
"""return columns"""
columns = [
_("Sales Invoice")+":Link/Sales Invoice:120",
_("Customer")+":Link/Customer:150",
_("Date")+":Date:Date",
_("Total HT")+":Link/Sales Incoice:120",
_("VAT")+":Link/Sales Invoice",
_("Total TTC")+":Link/Sales Invoice"
]
return columns
def get_sales_entries(filters):
return frappe.db.sql("""
(SELECT
`tabSales Invoice`.`name` AS `name`,
`tabSales Invoice`.`customer_name` AS `customer_name`,
`tabSales Invoice`.`creation` AS `creation`,
`tabSales Invoice`.`total` AS `total`,
`tabSales Invoice`.`total_taxes_and_charges` AS `total_taxes_and_charges`,
`tabSales Invoice`.`grand_total` AS `grand_total`
FROM
`tabSales Invoice`)""")
but i don’t know what’s the problem cz i checked other query reports and i did the same
any help ?