AttributeError: 'X' object has no attribute '_table_fieldnames'

After I created a new docType called Shipper Order, I navigated to the Shipper Order Form to check if it was properly rendered. and it was rendered successfully, but upon reloading the form page, an error appeared. and I’ve not made any change to the Shipper Order Controller

AttributeError: ‘ShipperOrder’ object has no attribute ‘_table_fieldnames’

How can i solved this error? if create new docType but without the Virtual enable all working fine.

Did you implement the load_from_db(self) method for your virtual doctype?

If you don’t have any data to load but just want to show an empty form, try this:

import frappe
from frappe.model.document import Document

class ShipperOrder(Document):
	# ...
	def load_from_db(self):
		super(Document, self).__init__({"name": frappe.generate_hash(length=8)})