In my custom app, I created couple of custom web forms, one of which is called Cheque Web Form for my Cheque Doctype.
Even though I can view the Cheque List with no issues, if I entered one of the Cheques that has a “/” (slash) in it (url mysite.com/cheque/CHQ-R-00094/25) gives me this error:
Traceback (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 20, in get_response
return renderer_instance.render()
File "apps/frappe/frappe/website/page_renderers/print_page.py", line 23, in render
return super().render()
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
html = self.get_html()
File "apps/frappe/frappe/website/utils.py", line 534, in cache_html_decorator
html = func(*args, **kwargs)
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
self.update_context()
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 163, in update_context
data = self.run_pymodule_method("get_context")
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 223, in run_pymodule_method
return method(self.context)
File "apps/frappe/frappe/www/printview.py", line 40, in get_context
doc = frappe.get_doc(frappe.form_dict.doctype, frappe.form_dict.name)
File "apps/frappe/frappe/__init__.py", line 1305, in get_doc
return frappe.model.document.get_doc(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 83, in get_doc
controller = get_controller(doctype)
File "apps/frappe/frappe/model/base_document.py", line 71, in get_controller
site_controllers[doctype] = import_controller(doctype)
File "apps/frappe/frappe/model/base_document.py", line 101, in import_controller
raise ImportError(
ImportError: cheque
If the name does not have “/” in it, the Cheque renders just fine. Even though the Cheque with and without slashes work fine in the Desk view. It might be something with the routing, as it properly handles the spaces in the URL, such as in the Address Web Form, but not the slashes. The desk just convert the slash into:
“mysite.come/app/cheque/CHQ-R-00094%2F25”
Any help?
Error screenshot:
Cheque with no slashes: