I am getting the following error in script report,
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 62, in application
response = frappe.handler.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
data = execute_cmd(cmd)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 939, in call
return fn(*args, **newargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py", line 110, in run
result = add_total_row(result, columns)
File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py", line 231, in add_total_row
result.append(total_row)
AttributeError: 'tuple' object has no attribute 'append'
This is the code in the py file, it is working fine if I turn off add total row. If I turn it on, I am getting this error, only on the production server, it is working fine on my virtualbox development environment.
Production Server:
ERPNext: v10.1.45 (master)
Frappe Framework: v10.1.44 (master)
Development:
ERPNext: v11.x.x-develop (d305a7a) (develop)
Frappe Framework: v11.x.x-develop (544707d) (develop)
def execute(filters=None):
if not filters.machine_number:
filters.machine_number = ""
if not filters.site:
filters.site = ""
sqlq = """select
a.site,
a.creation,
a.machine_number,
a.previous_reading,
a.meter_reading,
b.coin_count
from `tabCollection Entry` a right join `tabCollection Counting` b
ON a.name = b.collection_entry
where a.machine_number like '%{}%'
and coalesce(a.site, '<NULL>') like '%{}%'
and a.creation BETWEEN '{}' AND '{}'
""".format(filters.machine_number,filters.site,filters.from_date,filters.to_date)
columns = [
"Site:Link/Warehouse:100",
"Collected On :Date:150",
"Machine No.:Link/Asset:100",
"Previous Reading::100",
"Meter Reading::100",
"Counted Coins:Int:100"
]
data = frappe.db.sql(sqlq)
return columns, data