Closed zongo811 closed 2 years ago
why are you adding customization scripts in-app when doctype itself is not in any app but only lives in DB?
Custom doctypes should ideally use client scripts/server scripts instead of hooks that you've mentioned.
This behavior is intentional because custom doctypes don't have JS files on disk; but hooks might be okay to add.
Thank you for your quick response.
I want to add ClientScript to a DocType in another App that is beyond my control. For reasons unknown the developer of this App created the DocType with Custom=True and refuses to change it.
I just would like it better to have my Client Script in the Filesystem where I can "git" it instead of having it in the DB. doctype_js just seemed like an obvious solution.
I see a "but hooks might be okay" in your answer, would you accept a Change Request for this?
would you accept a Change Request for this?
Sure. It will need a little bit of clean up in code.
Basically for custom doctypes:
Right now it's ignoring all of them.
developer of this App created the DocType with Custom=True
This is weird, no app should create doctypes with Custom=True
:thinking:
Thank you, feature request was submitted.
Description of the issue
I created a DocType with the Flag Custom and tried to connect it with client scripts by using doctype_js and doctype_list_js in hooks.py. Unfortunately the scripts are not called. The hooks only work with DocTypes that have property Custom=False.
Context information (for bug reports)
Output of
bench version
Steps to reproduce the issue
test_scripts.js:
Observed result
After setting "Test Scripts" property "Custom=True" messages in list view and form view are not displayed. Scripts are no longer used.
Expected result
Messages in list view and form view are still displayed. Scripts are used independently of property "Custom".
Stacktrace / full error message
Additional information
OS version / distribution,
Frappe
install method, etc. Debian buster