Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure for Odoo running inside a container #59

Open
brandon-blb opened this issue Nov 8, 2023 · 8 comments
Open

How to configure for Odoo running inside a container #59

brandon-blb opened this issue Nov 8, 2023 · 8 comments
Labels
bug Something isn't working question Further information is requested

Comments

@brandon-blb
Copy link

Your setup
Version: 16.0
Operating System: MacOs (Running Odoo in docker using official image)
IDE and/or Integration tool (for example: Vscode - official extension): Vscode

Describe the bug
Not really bug, more a question. Cannot get the extension to detect odoo installation because it is inside the container.
I tried copying the Odoo folder (/usr/lib/python3/dist-packages/odoo/) from the container to my host, but extensions is not picking it up as a valid installation path.

How can I setup the extension so that it uses the python and odoo running in my container?

Thank you in advance

@fda-odoo fda-odoo added bug Something isn't working question Further information is requested labels Nov 13, 2023
@fda-odoo
Copy link
Collaborator

Hello @brandon-blb ,

Actually the extension has been developped with the odoo repository architecture in mind, and it can indeed not work with a pre-packaged odoo.
We will see if we can adapt our code to better handle the docker image, but until then, you can maybe organize your files to match the actual conditions:
a) odoo path should lead to a directory that contains:

  • a subdirectory "addons" with addons
  • a subdirectory "odoo" with the file "release.py" in it and a subdirectory "addons".
    b) all addons path should just lead to a directory with modules in it.
    Unfortunately addons and odoo/addons must be in the odoo path. Move them elsewhere is not possible for now.

I'll keep this issue opened until we managed to adapt the extension for docker images.
Don't hesitate to come back if you have any question

@brandon-blb
Copy link
Author

Thank you for your response.

Will see what I can do from my end. The idea for me is for my project to have the same "odoo source" in the container as well as my project folder.

This way I can use the python debugger to debug Odoo source code as well.
Will it work if i create a directory that mimics your above mentioned structure using symbolic links?

@brandon-blb
Copy link
Author

@fda-odoo

Then another question (still related to container setup)
If I clone the odoo source code from github, the extenstion works, but I get a warnings/errors regarding python packages not found.

I assume that this is because my host python (where I link the path) does not have all the packages installed and there is no way to link the python path to the python inside my container?

@fda-odoo
Copy link
Collaborator

It should work. I didn't tested it though, and I hope I don't forget a mandatory directory.

@fda-odoo
Copy link
Collaborator

I'm not really familiar with containers, but I think it would be quite difficult, as the container has its own python package installation. The extension can handle virtual envs, maybe you could create one that has the same installed packages than in your container?

@brandon-blb
Copy link
Author

Ok. Let me explore a bit and see what I can do.

Thanks

@al3ba
Copy link

al3ba commented Jan 5, 2024

in case it is helpful, The way I am currently working with this extension is by modifying the Docker file for the latest build which in my case is 17.0, removing the command that installs the prebuilt odoo package, and adding dependencies required for development which can be found in the documentation and then mounting the odoo source as a volume and setting that location in the extension configuration section.

@brandon-blb
Copy link
Author

@al3ba Thank you but I have a lot of projects setup using the prebuilt package (Default Odoo Docker Image).
For now, I am using a separate extension called (Odoo IDE) and it is working wonders for now.

Will wait until this extension supports the pre-built source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants