How to reload page after frappe.msgprint() using python

How to reload page after frappe.msgprint()?

I want to reload page after Workflow Status message is shown on list view of doctype.

I am able to override this function using below script in my custom app.

__version__ = '0.0.1'

# Default file import
from frappe.model import workflow

# Custom App file import
from custom_app.custom_app.custom.custome_workflow import custom_print_workflow_log

#Fucntion Overriding
workflow.print_workflow_log = custom_print_workflow_log

Now I am unable to reload page.
I am unable to use self.reload(), doc.reload()

tried below but after using this site shows internal server error

import pyautogui

pyautogui.hotkey('f5')

Requirement is simple that after showing message page should reload.

@umarless what is the context here ? you reloading the doctype on the list view page ? explain more please ?

Thanks for replying.

While Approving/Rejecting or Cancelling document from list view confirmation message(dialog box) shows, this dialog box (title “Workflow Status”) not gets close/hide automatically.

And If I will close that message/dialog box, list page not gets reload automatically.

So, I am trying to reload page so that message box will be close/hide and list view page will get reload/refresh to see latest changes in status of documents.

I hope this explained everything.
Thanks.

@umarless it should reload if your socketio port is opened and working fine .

1 Like

@bahaou thanks for support.

I done this testing to check socketio port.

image

Is this means my socketio port is opened and working fine?

If yes then please give hint.

If No, How can I open socket io port?

Thanks.