콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
207 화면

Dear Odoo Community,

We are currently implementing a CRM (and potentially a Helpdesk) for one of our clients. Security is a key requirement, so we are setting up development, staging, and production environments.

I’m happy to share that we've successfully created our first project in Odoo SH, made the first commits to the repository, and everything is running smoothly. I must say, Odoo SH is a powerful tool and I truly appreciate how it streamlines deployment and environment management so far.

That said, I do have a question regarding best practices for promoting changes across environments:

  • The GitHub repository linked to Odoo SH only tracks the files in the repo. As far as I understand, standard Odoo apps are installed and stored in the database rather than being tracked in GitHub.
  • When I install new apps, change system settings, or make configuration updates in staging, I would like these changes to be properly promoted to the production branch.
  • Additionally, our client plans to use Odoo Studio to add custom fields and make small adjustments in staging or dev. We also want to ensure those Studio changes are safely moved to production.

What is the correct way to handle this in Odoo SH? Are there recommended workflows or resources that explain how to properly promote database-level changes and Odoo Studio customizations across environments?

Any guidance, references, or shared experiences would be greatly appreciated.

Thanks in advance

아바타
취소
베스트 답변

I do it by scripting what is changed / configured in the staging database, so I can re-run the script in Production.

https://www.odoo.com/forum/help-1/easy-way-to-transfer-settings-from-one-database-to-another-can-i-export-them-can-i-programmatically-configure-a-database-184325


Odoo Studio is designed for a single User making relatively simple changes.

Odoo.sh is designed for a team of developers working as a team making complex changes.

Ideally you pick one or the other - so Odoo Studio is not install in most Odoo implemented databases hosted on Odoo.sh.


Odoo Studio changes can be exported and imported between databases - but test this first to ensure the export supports everything you need.

https://www.odoo.com/documentation/master/applications/studio/models_modules_apps.html#export-and-import-customizations

아바타
취소
작성자

Thanks for the input Ray, much appreciated. Yesterday I indeed got export-import to work. However it feels a bit clunky. Coming from a Python background I would like to see Studio just modify some sort of configuration file. And the configuration file is tracked in the repo. Upon push, Odoo would use the configuration file in the build.

작성자

OK in addition to this post I contacted Odoo Support and they referred to multiple of your sources, great. The lady in customer support mentioned that the best practice is to make this database schema changes and settings changes still manually in the production environment. I guess that's fine for now. It bothers me that I cannot get the database in a state using a script, the same way a dockerfile works for a container. Anyway, maybe Odoo could consider adding these best practices to the documentation.

Modules can run code the first time they are installed. You can see how we do this by reviewing the source code of the base module at https://github.com/odoo/odoo/blob/19.0/odoo/addons/base/__init__.py

post_init_hook(cr): This hook runs after the module is installed or upgraded, specifically after the database structure changes are applied. This is the hook used to run logic (like data migration or cleanup) every time a module is upgraded or freshly installed.

작성자

very helpful, thanks. I got PGAdmin to work on a local docker instance of Odoo to better understand the database model. very insightful to understand Odoo's inner workings. For now I will keep things simple and just use a bunch of backups, rebuilds etc.

Just be aware up to 30% of the data in any given Odoo database is not persisted in PostgreSQL (calculated/computed fields). Look for Fields in the Odoo Fields Menu (Developer Mode) that are not stored.

관련 게시물 답글 화면 활동
2
3월 25
7075
1
10월 24
2067
2
10월 24
3404
0
5월 25
3037
1
7월 24
2680