-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to the odoo-lsp wiki! Check out the pages on the sidebar to learn more about how to use odoo-lsp and its various features.
odoo-lsp operates based on a concepts of roots and allows strict management of which roots to include.
In short, they are similar to the arguments passed to --addons-path
when starting an Odoo server.
By default, when starting an editing session the only root is the working directory, and you can configure
this per directory by placing an .odoo_lsp
JSON configuration file at the directory from which you launch your editor.
Note
If you're using VSCode multi-root workspaces, they have the same effect as manually specifying addon roots in .odoo_lsp
.
// A sample configuration file
{
"module": {
"roots": [
"/path/to/modules", // absolute paths
"./foo", // or relative paths
"partner/addon-*", // or globbed paths all work
]
}
}
For example, for this given configuration:
.
.odoo_lsp
foo/
one/__manifest__.py
two/__manifest__.py
three/__manifest__.py
16/
odoo/addons/
15/
odoo/addons/
If one wants to only load foo
and 16
, the necessary configuration for .odoo_lsp
is as follows:
{
"module": {
"roots": ["16", "foo"]
}
}
This avoids loading 15
as a root and prevents issues with code completion. You can also run this command to generate the same config file:
# Optionally add --tsconfig to generate a tsconfig.json ready to be used by Typescript
odoo-lsp init --addons-path 16,foo --tsconfig
- Rely maximally on the source code, not the database
- Make it easier to adapt to new editors and situations
-
Odoo by Trịnh Anh Ngọc
- Paid plugin, only for IntelliJ IDEA
- VSCode port available
-
Odoo Autocompletion Support by WT-IO-IT GmbH
- https://github.com/wt-io-it/odoo-pycharm-plugin
- Free plugin, only for IntelliJ IDEA
- The basis for this LSP