Versioning On Frappe

Hello. im new to frappe i need help to do versioning on my apps

POC:

  1. I Create apps named testing-apps
  2. I Create Sites named testing.sites.local
  3. I Install testing-apps to testing.sites.local
  4. Now im Open the sites and create some doctype let say Doctype A and B
  5. I Create another sites testing2.sites.local and install testing-apps to the sites

The Problem :
Why Doctype A and B not exists on testing2.sites.local

The Goal :
I want to do versioning its like after i create doctype i want that doctype to be exists on my app and push it to git. so when i install app to another sites, the doctype will be exists

Hi,

Please make sure that development mode is enabled for your site testing.sites.local

Thanks,

Divyesh Mangroliya

its enabled, now how to update created doctype to the apps ?

Hi,

Please follow this documentation: Exporting Customizations to your App (frappeframework.com)

You need to export fixtures.

Thanks,

Divyesh Mangroliya

im follow that step already, and run bench update but customized doctype not synced to the testing-apps . also i try to git push and pull from the testing-apps but everything up to date, mean no file added from the bench update

Hi,

Did you run the following command for development site ?

bench --site mysite export-fixtures

Also, you need to run the following command after update

bench --site new-site migrate

Thanks,

Divyesh Mangroliya

yeah im run that already, but nothing happen on my apps

Hi,

Can you check one more thing, custom_fields.json file is created in fixtures folder and contains all the custom fields?

Thanks,

Divyesh Mangroliya

where i can find the fixtures folder ?


i have this customization on the testing.sites.local on the testing-apps apps modules.

when i run bench migrates it say syncing fixtures but still no new files added to my testing-apps

Hi,

You can find it under /frappe-bench/apps/your_app/your_app/fixtures

Also, check the content of custom_fields.json file.

Thanks,

Divyesh Mangroliya

Hi,

Also make sure you defined fixtures in hook.py as follows:

fixtures = [
    {"dt": "Custom Field"},
    {"dt": "Client Script"},
    {"dt": "Server Script"},
]

Thanks,

Divyesh Mangroliya

i found
/frappe-bench/apps/your_app/your_app/
but no fixtures folder
just found

  • pycache
  • your_apps
  • public
  • template
  • www
  • init.ys
  • hooks.py
  • modules.txt
  • patches.txt

no fixtures folder

Hi,

Please add the fixtures code I provided in above post in hook.py and run the export-fixtures command again.

It will create fixtures folder and inside three files.

Thanks,

Divyesh Mangroliya

thanks now i see that
it contains

  • Client Scrit
  • Server Script
  • Custom Field

now how to get my customized doctype ? i need to write the doctype name one by one ?

Hi,

you intend to say “customized doctype” means you added custom fields by clicking Customize Form on Standard Doctype? or any Newly added Doctypes as part of custom app?

With the above setup both the cases should work.

Thanks,

Divyesh Mangroliya

i mean Newly added Doctypes as part of custom app.

i got it, i added it one by one on hooks.py, when i run export-fixtures its inserted to my custom app fixtures.

is there any other way ?

Hi,

Something is not correct. If your site is in developer mode and once you add any new Doctype, system will create boilerplate code under /frappe-bench/apps/your_app/your_app/your_module/doctype

Please make sure your site is in developer mode.

Thanks,

Divyesh Mangroliya

my site_config.json have "developer_mode": 1,

do i need something to activate it ??? maybe restart bench or something ?

Hi,

I am suggesting you to have look at this free course: Library Management with Frappe Framework

This course will help you clear up all your doubts.

Thanks,

Divyesh Mangroliya