Problem in display new module list

hello,
In config folder i have created gym.py file for module listing in which i had used setup just once but it is displaying twice and second listing is not there in my gym.py file

Traceback (most recent call last):
File “/home/manasvi/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/manasvi/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/manasvi/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/manasvi/frappe-bench/apps/frappe/frappe/init.py”, line 939, in call
return fn(*args, **newargs)
File “/home/manasvi/frappe-bench/apps/frappe/frappe/desk/form/load.py”, line 71, in getdoctype
docs = get_meta_bundle(doctype)
File “/home/manasvi/frappe-bench/apps/frappe/frappe/desk/form/load.py”, line 81, in get_meta_bundle
bundle = [frappe.desk.form.meta.get_meta(doctype)]
File “/home/manasvi/frappe-bench/apps/frappe/frappe/desk/form/meta.py”, line 22, in get_meta
meta = frappe.cache().hget(“form_meta”, doctype, lambda: FormMeta(doctype))
File “/home/manasvi/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 173, in hget
value = generator()
File “/home/manasvi/frappe-bench/apps/frappe/frappe/desk/form/meta.py”, line 22, in
meta = frappe.cache().hget(“form_meta”, doctype, lambda: FormMeta(doctype))
File “/home/manasvi/frappe-bench/apps/frappe/frappe/desk/form/meta.py”, line 34, in init
self.load_assets()
File “/home/manasvi/frappe-bench/apps/frappe/frappe/desk/form/meta.py”, line 41, in load_assets
self.add_code()
File “/home/manasvi/frappe-bench/apps/frappe/frappe/desk/form/meta.py”, line 64, in add_code
path = os.path.join(get_module_path(self.module), ‘doctype’, scrub(self.name))
File “/home/manasvi/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 138, in get_module_path
return frappe.get_module_path(module)
File “/home/manasvi/frappe-bench/apps/frappe/frappe/init.py”, line 720, in get_module_path
return get_pymodule_path(local.module_app[module] + “.” + module, *joins)
KeyError: u’manasvi’

Hi @Manasvi_Patel,

the second header is created from the system itself. The listed two DocTypes will have Show in Module Section set to “Setup”.

Set this to blank, save. Then run bench migrate.

Hope this helps.

no it’s not work

Can you share your source of gym.py? When does the error occur?

from frappe import _

def get_data():
	return [
		{
			"label": _("setup"),
			"items": [
				{
					"type": "doctype",
					"name": "plan",
					"description": _("Bills raised to Customers.")
				},
				{
					"type": "doctype",
					"name": "Purchase Invoice",
					"description": _("Bills raised by Suppliers.")
				},
				{
					"type": "doctype",
					"name": "Payment Request",
					"description": _("Payment Request")
				},
				{
					"type": "doctype",
					"name": "Payment Entry",
					"description": _("Bank/Cash transactions against party or for internal transfer")
				},
				{
					"type": "page",
					"name": "pos",
					"label": _("POS"),
					"description": _("Point of Sale")
				},
				{
					"type": "doctype",
					"name": "Subscription",
					"label": _("Subscription"),
					"description": _("To make recurring documents")
				},
				{
					"type": "report",
					"name": "Accounts Receivable",
					"doctype": "Sales Invoice",
					"is_query_report": True
				},
				{
					"type": "report",
					"name": "Accounts Payable",
					"doctype": "Purchase Invoice",
					"is_query_report": True
				}
			]

		}
		
	]

reply plz…

Hi @Manasvi_Patel,

the gym.py looks fine. But I am still unclear when the error occurs. Is it when you refresh the module page or click an item? Have you checked that upon bench migrate the .pyc files get updated? Maybe try uninstalling and re-installing your app?

No matter how much I did, I was not able to create the module list. (As in the first picture)