Replies: 1 comment
-
|
Hello @BerndHme ,
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I would like to open this discussion to find out what are common, stable and sound development setups for odoo development,
and to find out what experienced odoo developers use for their daily development.
I've been struggling to find the right one, what IDE to use and what extensions to use to get maximum snippets, intellisense and linting support.
What is recommended, what works for you?
I'm fairly new at odoo development,
I like the software, but I don't like the development experience as much as I like more adult frameworks like .NET and Angular.
The main reason is that I find it hard to find good stable tooling for the server- and web-framework.
I'm also not as keen on using unverified extensions from the marketplace,
some are old and have many installs, but are not relevant for the new 18.0 and 19.0 versions,
others are new and maybe promising, but I'd rather stick to the official ones just for safety.
What editor / IDE do you use, and why?
What OS do you use to develop in, and why?
My setup for now.
I'd be happy to hear what you think of it, what can be better, what is your experience and opinion.
Until recently I entirely developed on plain Windows11, now I still use windows but I develop in WSL and use docker containers to run the app.
Folder structure
For the plain windows setup, I have this workspace folder structure with all repose as below.
Also I've set this up for each version of odoo, one directory for each
Launch settings
I do this full source code setup because I want to debug the entire application.
So I start odoo as a windows process entirely, I run python from a .venv with debugpy installed.
I let vscode start the odoo-bin file and automatically attach debugpy.
This way I can set breakpoints throughout the entire source code.
This is an example of .vscode/launch.json config.
Extensions
The extensions I use currently are these.
What do you use?
Flake8 & autopep8
For the Flake8 and autopep8 formatting I use this config for now.
I suppress some errors and warnings so I'm a bit more free to structure the code.
This is my .config/.flake8 file.
Odoo
I've placed the odools.toml inside the .config directory, so I can actually create a git repo for this and back it up remotely.
This is my .config/odools.toml file.
Workspace settings
This is my workspace .vscode/settings.json.
You notice I still use the Pylance language server.
I use this because I actually like the colorization it brings on symbols,
and also I recently discovered these inlay hints settings, which I find very useful for reading and debugging code.
I've also created a feature request to implement this functionality in the odoo-ls extension as well.
jsonfig.json
For easy navigation between javascript modules,
I've got a jsconfig.json setup with these pathmappings, maybe it's not 100% correct, but it helps.
This is my jsconfig.json file
Other
At the moment I don't use any snippets ... but I'm going to try out the Odoo Shortcuts extension from mvintg
... seems an interesting one.
The thing about snippets, I actually quite rely on copilot chat.
If I need a fresh module setup, I plan out context with the planning agent,
and let it generate a complete structure for me which I then abstract and refine.
WSL & Docker
Recently I've set up docker containers to run the db and odoo instance in.
But because I want to be able to debug easily with breakpoints, I needed to mount the source code entirely on the odoo container.
If I do this with the source code stored on windows itself, reading and writing is terribly slow, so I recently moved to WSL.
Using mounted source code from there is way more performant than mounting from windows.
So now I use a vscode remote window to WSL, where I created this development workspace.
Folder structure
My new workspace looks like this.
Dockerfile
I use the official odoo:18.0 image as a base, so I don't need to manage all necessary dependencies for running odoo.
I remove the installed odoo package from it, therefore removing the source code so I can mount my own source code.
This way I'm certain I have only one source of truth.
If I don't remove the odoo package, the core odoo modules still run from the package instead of from the source code I mount because of entries in the system-path variable if I'm correct,
resulting in not being able to trigger breakpoints from the core addons.
The whole reason for manipulating this image is to be able to use it for debugging.
So I also install venv to create a virtual environment in the image, and install the debugpy package there.
I also re-install the odoo-user, and set file permissions.
This is my .docker/Dockerfile
Compose files
Below are the compose files I use.
I use the same database for all the project containers, maybe that is bad practice, I'm happy to hear your thoughts.
Remember this is a development setup. I wouldn't do this in production, but maybe I also shouldn't in development, I don't know.
This is my .docker/postgres/compose.yaml.
This is my .docker/odoo/compose.yaml
PyCharm
I've just recently installed PyCharm to try it out.
Here my questions are
Regarding the WSL setup, I noticed that you can't have a remote window to WSL with the free version of PyCharm,
at least to my understanding.
So here I assume you're actually better of using Mac of Linux for development, correct?
Maybe that is even the default way?
On the other hand, I actually like just using vscode because of its versatility, but that shouldn't be a reason not to try other setups I think.
VSCodium
I haven't tried this.
Main Goal
So to recap, the reason why I start this discussion is to find out what is a very good and comfortable development setup for Odoo.
If people can share their thoughts, I think it would help me and possibly others a great deal,
and who knows stimulate the growth of the Odoo platform from the perspective of developers and technical people,
making their lives a bit more easy and help new people quickly set up and learn the framework and all its aspects.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions