avc
February 13, 2023, 9:48pm
4
Take a look here. Objects like client/server scripts are really “data” on doctypes.
If all your doctypes are custom ones and included in the custom app then just do bench build and bench migrate.
If your customizations are for standard doctypes and written in client script, then you got to use fixtures in the hooks file to export them to the app.
fixtures = [
{
"doctype": "Client Script",
"filters" : [
"name",
"in",
[
'name_of_client_Scipt'
]
]
}
]
yes
Add your custom script in hooks.py,
if script in custom location,
doctype_js = { "Item": "custom_scripts/item.js", }
if custom script is created in UI,
{ "doctype": "Custom Script", "filters": [ ["name", "in", ( "Employee-Client", )] ] },
export your custom script using bench export-fixtures command
Use hooks.py to set the fixtures you want to export. In your case, client script. The module is the filter:
fixtures = [{"doctype": "Client Script", "filters": [["module" , "in" , ("yourmodule" )]]}]
Then run bench export-fixtures . This will create a folder called “Fixtures” on your app directory. Inside you can find a json file with the script content.
Hope this helps.
2 Likes