Deploying Custom App does not deploy all customization. Why?

Hello,

I have built a custom app in ERPNext 13 which has 4 DocTypes and it is working properly locally.

I just deployed it to a remote server.

The app got installed and it working but I observed that the customization that I have done in Client Script did not get deployed.

Any ideas what mistake I am making here?

Why is the Client script associated with a DocType of my Custom App does not get deployed?

What is the best way to solve this problem?

TIA

Yogi Yang

You should have client scripts in your app. Check how to export fixtures.

Hello,

I am confused here because the documentation only talks about exporting records from a DocType.

https://frappeframework.com/docs/v13/user/en/python-api/hooks#fixtures

I reached here from this section of the documentation.
https://frappeframework.com/docs/v13/user/en/bench/resources/bench-commands-cheatsheet#development

TIA

Yogi Yang

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'
                ]
             ]
     }
 ]
1 Like

not working show error

dev@24:~/icrm$ bench export-fixtures --app icrm
Exporting Client Script app icrm filters ['name', 'in', ['Owned by']]
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/dev/icrm/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
  File "/home/dev/icrm/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/dev/icrm/env/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/env/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/env/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/env/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/env/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/env/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/env/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/apps/frappe/frappe/commands/utils.py", line 383, in export_fixtures
    export_fixtures(app=app)
  File "/home/dev/icrm/apps/frappe/frappe/utils/fixtures.py", line 81, in export_fixtures
    export_json(
  File "/home/dev/icrm/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 299, in export_json
    for doc in frappe.get_all(
               ^^^^^^^^^^^^^^^
  File "/home/dev/icrm/apps/frappe/frappe/__init__.py", line 2057, in get_all
    return get_list(doctype, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/apps/frappe/frappe/__init__.py", line 2032, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/apps/frappe/frappe/model/db_query.py", line 191, in execute
    result = self.build_and_run()
             ^^^^^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/apps/frappe/frappe/model/db_query.py", line 206, in build_and_run
    args = self.prepare_args()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/dev/icrm/apps/frappe/frappe/model/db_query.py", line 243, in prepare_args
    self.sanitize_fields()
  File "/home/dev/icrm/apps/frappe/frappe/model/db_query.py", line 413, in sanitize_fields
    lower_field = field.lower().strip()
                  ^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'lower'

need to do this

fixtures = [
    {
        "doctype": "Client Script",
        "filters": [
            ["name", "in", ["name_of_client_script"]]
        ]
    }
]

after this this will work and show

dev@24:~/icrm$ bench export-fixtures --app icrm
Exporting Client Script app icrm filters [['name', 'in', ['Owned by']]]