[v8] New Script Report not loading

Hi,

I have created a new script report after updating to v8, the following steps I have followed:

  1. Create a script report, make it as standard for my custom app
  2. The report on saving created a folder within the custom app
  3. Now I added a simple filter in the report to check if the report is working
  4. Logging into the report does not load the filter and the below console error is there
  5. The letter head is left blank
Uncaught SyntaxError: Unexpected string
    at Object.eval (desk.min.js:595)
    at Object.callback (report.min.js:1082)
    at Object.callback [as success_callback] (desk.min.js:1319)
    at 200 (desk.min.js:1344)
    at Object.<anonymous> (desk.min.js:1444)
    at i (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at z (jquery.min.js:4)
    at XMLHttpRequest.<anonymous> (jquery.min.js:4)
eval @ desk.min.js:595
callback @ report.min.js:1082
callback @ desk.min.js:1319
200 @ desk.min.js:1344
(anonymous) @ desk.min.js:1444
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
z @ jquery.min.js:4
(anonymous) @ jquery.min.js:4
report.min.js:1087 Uncaught TypeError: Cannot set property 'html_format' of undefined
    at report.min.js:1087
    at Function.<anonymous> (desk.min.js:1568)
    at Function.each (jquery.min.js:2)
    at Object.frappe.request.cleanup (desk.min.js:1567)
    at Object.<anonymous> (desk.min.js:1460)
    at i (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at z (jquery.min.js:4)
    at XMLHttpRequest.<anonymous> (jquery.min.js:4)

I think there is some issue with the way the new report json is being created

Hi @adityaduggal

Seems there is an issue in the code of adding the filters, can you please share your code

Hi Rohit,

The only code I have is in the js file and that is as below:

// Copyright (c) 2016, Rohit Industries Ltd. and contributors
// For license information, please see license.txt

frappe.query_reports["SI Import to RIGB RU"] = {
	"filters": [
		{
			"fieldname":"id",
			"label": "Sales Invoice Number",
			"fieldtype": "Link",
			"reqd": 1,
			"options": "Sales Invoice"
			"get_query": function(){ return {'filters': [['Sales Invoice', 'docstatus','=',1]]}}
		}
	]
}

Kindly add comma(,) :slight_smile:

1 Like

Really embarrassing :blush: