Virtual Doctype Error

I am trying the new Virtual Doctype using the example on this page: Virtual DocTypes

When I list or refresh the doctype, I get a TableMissingError as if the framework is expecting a database table to exist

12:25:14 web.1            | Traceback (most recent call last):
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/app.py", line 68, in application
12:25:14 web.1            |     response = frappe.api.handle()
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/api.py", line 54, in handle
12:25:14 web.1            |     return frappe.handler.handle()
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/handler.py", line 31, in handle
12:25:14 web.1            |     data = execute_cmd(cmd)
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/handler.py", line 67, in execute_cmd
12:25:14 web.1            |     return frappe.call(method, **frappe.form_dict)
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/__init__.py", line 1174, in call
12:25:14 web.1            |     return fn(*args, **newargs)
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/__init__.py", line 609, in wrapper_fn
12:25:14 web.1            |     retval = fn(*args, **get_newargs(fn, kwargs))
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/desk/reportview.py", line 44, in get_count
12:25:14 web.1            |     return execute(**args)[0].get('total_count')
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/desk/reportview.py", line 47, in execute
12:25:14 web.1            |     return DatabaseQuery(doctype).execute(*args, **kwargs)
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/model/db_query.py", line 101, in execute
12:25:14 web.1            |     self.columns = self.get_table_columns()
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/model/db_query.py", line 338, in get_table_columns
12:25:14 web.1            |     return get_table_columns(self.doctype)
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/model/meta.py", line 49, in get_table_columns
12:25:14 web.1            |     return frappe.db.get_table_columns(doctype)
12:25:14 web.1            |   File "/workspace/development/frappe-13/apps/frappe/frappe/database/database.py", line 896, in get_table_columns
12:25:14 web.1            |     raise self.TableMissingError('DocType', doctype)
12:25:14 web.1            | pymysql.err.ProgrammingError: ('DocType', 'Customer')

Virtual Doctypes aren’t really working yet, or at least it’s not clear to me how to get them to work. There’s some discussion and fixes in the pipeline, but not clear when it will all be merged:

Many Important newly released Features does not work. Like Custom DocType Layout does not work also - released a long time back . Setting Autoname instead of naming series does not work .Custom Doctype and Virtual Docs are the backbones for designing the system in every different way.

It’s difficult to understand what policy the Frappe team have to include such not working features ( Not working at all - not bugs ) . And they can be fixed easily too

2 Likes

@RWEMA_Aimable
You can check out this YouTube tutorial on virtual doctype