I uninstalles pos awesome after that i am facing problem with doctype like i was not able to acess sales invoice it was saying doctype pos offer not found now i am unable to update my site there is a error while migrating
“frappe.core.doctype.doctype.doctype.WrongOptionsDoctypeLinkError: Address: Options must be a valid DocType for field Delivery Charges in row 21”
Why such an issue can occur?
For any app installed, there are some custom fields and doctypes installed.
However, when you uninstall the app, only doctypes are removed. Custom Fields Stay.
You get this error when there are link fields linked to removed doctypes.
How to resolve?
Delete linked custom fields.
These are the fields created. Search for Link and delete them from bench console.
You can use something like this as all field names start with posa_
Possibly, Not actually- no customization by the user, someone else also reported the same error some days back to me on telegram. It could be due to some additional app which (non tech) users are not aware.
He didn’t customize any sort. Infact was also hosted on erp cloud instance!
Did you actually run this script? I tried several different ways to get it running but it seems to be disabled due to security issues. See a similar observation by someone else here
I obtain the same error message as reported in the other thread.
Traceback (most recent call last):
File “apps/frappe/frappe/desk/doctype/system_console/system_console.py”, line 17, in run
safe_exec(self.console)
File “apps/frappe/frappe/utils/safe_exec.py”, line 85, in safe_exec
exec(
File “”, line 2, in
File “apps/frappe/frappe/query_builder/utils.py”, line 86, in execute_query
query, params = prepare_query(query)
File “apps/frappe/frappe/query_builder/utils.py”, line 131, in prepare_query
raise frappe.PermissionError(“Only SELECT SQL allowed in scripting”)
frappe.exceptions.PermissionError: Only SELECT SQL allowed in scripting
To reply to my own question: The suggested solution worked. My confusion was that I used the system console and/or server script instead of bench console.
In my case, just changing the doctype didn’t resolve the issue. I went with the deletion suggestion: