odoo-ls icon indicating copy to clipboard operation
odoo-ls copied to clipboard

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

Open brboi opened this issue 1 year ago • 3 comments

Version: 0.2.6

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

image

brboi avatar Oct 10 '24 15:10 brboi

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 :)

fda-odoo avatar Oct 10 '24 15:10 fda-odoo

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

brboi avatar Oct 14 '24 11:10 brboi

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.

fda-odoo avatar Oct 14 '24 13:10 fda-odoo

0.8.0 bring a whole new way to configure your environment, so this thread is not relevant anymore. Do not hesitate to open a new issue if you have feedback or problem configuring your setup with the new version. You can find some help here: https://github.com/odoo/odoo-ls/wiki/Configuration-files

fda-odoo avatar Jul 09 '25 12:07 fda-odoo