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

Odoo.configurations setting has an application scope and can be set only in the user settings file #140

Open
brboi opened this issue Oct 10, 2024 · 3 comments

Comments

@brboi
Copy link

brboi commented Oct 10, 2024

Version: 0.2.6

Not able to configure the Odoo.configurations setting in the workspace settings:

image

@fda-odoo
Copy link
Collaborator

Hello!

This is because you shouldn't. Configurations are not workspace-bound, but defined one time only for all your workspaces.
In your workspace, you only have to select the index of the configuration you want to use. It allows you to define only one configuration and use in multiple workspaces.
If you want to see which settings are created automatically before editing your settings.json, try to play with the "Odoo" button on the bottom left of your vscode window. Create a configuration and select it to use it for your workspace.
I hope it answers your question, do not hesitate to come back if you still have any question :)

@brboi
Copy link
Author

brboi commented Oct 14, 2024

Thanks @fda-odoo

I am working on a devcontainer for odoo development and I would like to ship it with defaults settings for this extension.

I can not achieve this with only user settings, true?
https://github.com/brboi/odoo-dev/blob/437ec6689143e00b2b04ae3a84f5b90c81cd09ba/.devcontainer/devcontainer.json#L68

@fda-odoo
Copy link
Collaborator

Hello @brboi ,
Indeed it has to be done in user settings.
In the actual vscode design, this configuration is stored at User level, as it has to be available for every project

"Odoo.configurations": {
         "0": {
         "id": 0,
         "name": "Odoo LS",
         "odooPath": "${workspaceFolder}/src/community",
         "rawOdooPath": "${workspaceFolder}/src/community",
         "addons": [
             "${workspaceFolder}/src/enterprise",
             "${workspaceFolder}/src/extra-addons/design-themes",
             "${workspaceFolder}/src/extra-addons/industry",
             "${workspaceFolder}/src/extra-addons/industry/tests",
             "${workspaceFolder}/src/extra-addons/runbot"
        ],
        "pythonPath": "python3"
    }
}

But this configuration:

	"settings": {
		"Odoo.selectedConfiguration": -1
	}

is stored at workspace level, and indicate which User settings the workspace is using.

I didn't test, but you should be able to store everything at workspace level, as any setting is overriding others in this order:
Workspace > remote > User > default
The extension code is getting the configurations with "workspace.getConfiguration().update("Odoo.configurations")", so it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants