Custom app without doctype

Hi.
I created new app with bench new-app myapp. Then installed this app on site with bench --site erpnext.vm install-app myapp. After I create script report in that app. App icon doesn’t appear on desktop and when I try access to my app through search bar it throw an error:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 876, in call
return fn(*args, **newargs)
TypeError: get() takes exactly 1 argument (0 given)

But I can access my report through search bar and it works without error. If I create any doctype in my app it starts to show icon on desktop and opens without any error showing created doctype and report. Tried it on master and develop V7 with last updates on vm, both same behavior. I want to create custom app to be able to make script reports, without creating doctype. So is it possible to make an app without doctype? I am not a programmer, just made this by reading tutorials and forum, and will be very glad if someone could help me. Thank you.

hi @Hadzhi,
please share the script.
please check the parameter you passed in the method.

Sagar Shiragawakar
New Indictrans Technologies Pvt Ltd.

1 Like

Thank you for your reply @sagar .
Here is script:

from __future__ import unicode_literals
import frappe	
from frappe import _

def execute(filters=None):
columns = [
	_("Cost Center") + ":Link/Cost Center:140",
	_("Sales") + ":Currency:100",
	_("Expences") + ":Currency:100",
	_("Profit") + ":Currency:100",
	_("Profit Margin %") + ":Percent:120",]
data = frappe.db.sql("""
	select
	    cost_center, sum(credit), sum(debit), sum(credit)-sum(debit), (sum(credit)-sum(debit))/sum(credit)*100
	from
	    `tabGL Entry`
	where
	    cost_center IS NOT NULL AND posting_date>"%s" AND posting_date<"%s"
	group by
               cost_center
		""" % (filters["from_date"], filters["to_date"]))

return columns, data

js file:

frappe.query_reports["Cost Center Wise"] = {
	"filters": [
		{
			fieldname: "from_date",
			label: __("From Date"),
			fieldtype: "Date",
			default: frappe.defaults.get_user_default("year_start_date"),
		},
		{
			fieldname:"to_date",
			label: __("To Date"),
			fieldtype: "Date",
			default: get_today()
		},
	]
}

json file:

{
 "add_total_row": 1, 
 "apply_user_permissions": 1, 
 "creation": "2016-07-29 03:22:41.327266", 
 "disabled": 0, 
 "docstatus": 0, 
 "doctype": "Report", 
 "idx": 0, 
 "is_standard": "Yes", 
 "modified": "2016-07-29 03:22:41.327266", 
 "modified_by": "Administrator", 
 "module": "My Reports", 
 "name": "Cost Center Wise", 
 "owner": "Administrator", 
 "ref_doctype": "Sales Invoice", 
 "report_name": "Cost Center Wise", 
 "report_type": "Script Report"
}

But I think the problem is not script report,because if I access the report from search bar, it works fine.The problem is that app icon doesn’t appear on desk and I can not access the page of my app. If I try access the page of my app from search bar, I get above error. Bus as soon as I make any doctype related to my app, app icon appears on desk and app page opens showing created doctype and report. Is there any limitation in framework that any app must contain at least one doctype and can not contain only reports?
Thank you.