I enabled Web View for Doctype Airplane Flight, added Is Published and Router field but below error is showing after clicking on any Airplane Flight from list.
Traceback (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 20, in get_response
response = renderer_instance.render()
File "apps/frappe/frappe/website/page_renderers/document_page.py", line 41, in render
html = self.get_html()
File "apps/frappe/frappe/website/utils.py", line 523, in cache_html_decorator
html = func(*args, **kwargs)
File "apps/frappe/frappe/website/page_renderers/document_page.py", line 50, in get_html
self.update_context()
File "apps/frappe/frappe/website/page_renderers/document_page.py", line 57, in update_context
self.context.update(self.context.doc.get_page_info())
AttributeError: 'AirplaneFlight' object has no attribute 'get_page_info'
From what class herit your Airplane Flight class ? Document I guess ?
May be you should check in ERPNext or Frappe core code some website page to find existing example.
My hint, the solution is to change class heritage of your Airplane Flight Doctype
You’ll find a class where this method is implemented.
You just have to make the import statement and put it as constructor heritage on your class AirplaneFlight
That’s the method I used to solved this riddle when I made this training.
My guess is, Hussain let this undocumented to let trainers prove or improve their skills in digging into Frappe Framework mechanics
Really really nice training by the way, I’ve spent a real good time by implementing this app. It demonstrate how power full (battery included, as it was said) Frappe framework is.
Yes this is the solution, but …
What do you think about let learner/student to find and understand what they doing, by themself, rather than find a solution with a query on “whatever is their search engine” (preferably not G… or B…, cause of data privacy matter) on the Frappe forum ?
Wouldn’t it make them better developers on Frappe framework and acquire a most valuable knowledge of how it is design by Frappe team to work ?
I think, if Hussein didn’t make this strait forward, it’s by design.