I tried using the export-fixtures to export certain web-hooks I created under the Webhook doctype but it didn't work for it. Is there a way to do this using the export-fixtures? If not, how can I export the webhooks? Side note: I also have two other doctypes I wanted to create fixtures for. Thanks
As much as this was clear i also want to track custom fields too and upon adding "Custom Fields" in the fixtures array there is an error presented. How else can this be solved?
@@BuildWithHussain Exporting County app mauzo_link filters None Exporting Custom Fields app mauzo_link filters None Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/workspace/development/mauzolink/apps/frappe/frappe/utils/bench_helper.py", line 114, in main() File "/workspace/development/mauzolink/apps/frappe/frappe/utils/bench_helper.py", line 20, in main click.Group(commands=commands)(prog_name="bench") File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/apps/frappe/frappe/commands/__init__.py", line 29, in _func ret = f(frappe._dict(ctx.obj), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/apps/frappe/frappe/commands/utils.py", line 369, in export_fixtures export_fixtures(app=app) File "/workspace/development/mauzolink/apps/frappe/frappe/utils/fixtures.py", line 81, in export_fixtures export_json( File "/workspace/development/mauzolink/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 287, in export_json for doc in frappe.get_all( ^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/apps/frappe/frappe/__init__.py", line 1970, in get_all return get_list(doctype, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/apps/frappe/frappe/__init__.py", line 1945, in get_list return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/apps/frappe/frappe/model/db_query.py", line 197, in execute self.columns = self.get_table_columns() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/apps/frappe/frappe/model/db_query.py", line 554, in get_table_columns return get_table_columns(self.doctype) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/apps/frappe/frappe/model/meta.py", line 73, in get_table_columns return frappe.db.get_table_columns(doctype) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/development/mauzolink/apps/frappe/frappe/database/database.py", line 1183, in get_table_columns raise self.TableMissingError("DocType", doctype) pymysql.err.ProgrammingError: ('DocType', 'Custom Fields')
I am creating a custom app using frappe framework version 15 and my app has around 10 to 15 server scripts and around 10 reports. I want these scripts and reports to be available by default to all customers/sites. How do I go about it?
Export fixtures is more flexible, export customisation just gives you a JSON file of the customisations, which you don’t have much control over, but in fixtures you can apply filters.
Role permission manager is just meant for customisation layer and cannot/should not be exported. Permissions set in doctype get added to Doctype JSON file in development.
Great Video!!! Can you make a video explaining how to add custom buttons to frappe or erpnext doctype from an custom app that you created without making any code changes to erpnext or frappe?
Long Live Frappe!
Amazing Video!!
Helped me alot in understanding fixtures and doc events
I tried using the export-fixtures to export certain web-hooks I created under the Webhook doctype but it didn't work for it. Is there a way to do this using the export-fixtures? If not, how can I export the webhooks? Side note: I also have two other doctypes I wanted to create fixtures for. Thanks
Hey 👋
Can you share your code that you have for fixtures?
As much as this was clear i also want to track custom fields too and upon adding "Custom Fields" in the fixtures array there is an error presented. How else can this be solved?
What error? Can you share?
@@BuildWithHussain
Exporting County app mauzo_link filters None
Exporting Custom Fields app mauzo_link filters None
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/workspace/development/mauzolink/apps/frappe/frappe/utils/bench_helper.py", line 114, in
main()
File "/workspace/development/mauzolink/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
click.Group(commands=commands)(prog_name="bench")
File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/env/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/apps/frappe/frappe/commands/__init__.py", line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/apps/frappe/frappe/commands/utils.py", line 369, in export_fixtures
export_fixtures(app=app)
File "/workspace/development/mauzolink/apps/frappe/frappe/utils/fixtures.py", line 81, in export_fixtures
export_json(
File "/workspace/development/mauzolink/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 287, in export_json
for doc in frappe.get_all(
^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/apps/frappe/frappe/__init__.py", line 1970, in get_all
return get_list(doctype, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/apps/frappe/frappe/__init__.py", line 1945, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/apps/frappe/frappe/model/db_query.py", line 197, in execute
self.columns = self.get_table_columns()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/apps/frappe/frappe/model/db_query.py", line 554, in get_table_columns
return get_table_columns(self.doctype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/apps/frappe/frappe/model/meta.py", line 73, in get_table_columns
return frappe.db.get_table_columns(doctype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/development/mauzolink/apps/frappe/frappe/database/database.py", line 1183, in get_table_columns
raise self.TableMissingError("DocType", doctype)
pymysql.err.ProgrammingError: ('DocType', 'Custom Fields')
and the way i used the fixtures
fixtures =[
{
"dt": "County",
},
"Custom Fields"
]
Found my error. Namimg issue
I am creating a custom app using frappe framework version 15 and my app has around 10 to 15 server scripts and around 10 reports. I want these scripts and reports to be available by default to all customers/sites. How do I go about it?
Why server scripts? If you are doing custom app, you can use doc_events hook instead. Reports you can mark standard to bundle with app.
is there a difference between export-fixtures & export customization (from customize doctype)
?
Export fixtures is more flexible, export customisation just gives you a JSON file of the customisations, which you don’t have much control over, but in fixtures you can apply filters.
@@BuildWithHussain 🌹😍
How to export the role permission from doctype?
Role permission manager is just meant for customisation layer and cannot/should not be exported. Permissions set in doctype get added to Doctype JSON file in development.
very nicely explained
how can custom doctype python and js standard app like Sales Order in custom app
Can you please elaborate?
If you want to customize standard doctype, you can use client scripts + doc_events.
how can i pass the doc name as parameter in doc events?
Hey 👋
Why do you want that? You get the whole “doc” object, so you can just do doc.name, or am I getting the question wrong? 🤔
@@BuildWithHussain thanks got it
thanks
Great Video!!!
Can you make a video explaining how to add custom buttons to frappe or erpnext doctype from an custom app that you created without making any code changes to erpnext or frappe?
Use client scripts and export fixtures for exporting the client scripts.
Really helpful
Your are master men
😘🌹🌹