Odoo
Sublime text syntax highlighting for QWeb templates, OWL templates and views.
Details
Installs
- Total 17
- Win 3
- Mac 3
- Linux 11
| Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sublime - Odoo
Snippets
Add some snippets for common code - new model - overwrite a model - views (form, list, kanban, search, etc) - common methods (create, write, etc)
Check the snippet folder to see what's available.
Syntax highlighting
Syntax highlighting for QWeb templates, OWL templates, views, and access CSV files.
Choose “XML - Odoo”, and it will automatically choose the right syntax
- OWL syntax (with JS in expression) if inside <templates/>
- View syntax (with python in expression) if inside <odoo/>
It highlight JS template inside Python template (eg template of kanban views)
It also highlight mail templates and “backend” templates.
And ir.model.access.csv
With this syntax highlighting comes the symbols, you can jump to view / component template with ctrl+r / ctrl+shift+r
Go To Definition
You can configure key bind to make “go to definition” work in views / OWL components (it uses sublime text symbols indexes, and so many results can be returned, they are sorted with a heuristic, similar filenames are displayed first).
// Standard sublime text `goto_definition`
{ "keys": ["primary+d"], "command": "goto_definition" },
// When the LSP has the feature
{
"keys": ["primary+d"],
"command": "lsp_symbol_definition",
"context": [
{ "key": "lsp.session_with_capability", "operand": "definitionProvider" },
{ "key": "auto_complete_visible", "operand": false }
]
},
// Custom Odoo "Go To Definition"
{
"keys": ["primary+d"],
"command": "goto_definition_odoo_xml",
"context": [{ "key": "selector", "operator": "equal", "operand": "text.xml.odoo-view, text.xml.owl, text.xml.odoo" }]
},
Same for goto_reference.
“json
{ "keys”: [“primary+shift+r”], “command”: “goto_reference” },
{
“keys”: [“primary+shift+r”],
“command”: “goto_reference_odoo_xml”,
“context”: [{ “key”: “selector”, “operator”: “equal”, “operand”: “text.xml.odoo-view, text.xml.owl, text.xml.odoo” }]
},
<p align="center">
<img src="img/go_to_definition_1.png">
</p>
<p align="center">
<img src="img/go_to_definition_2.png">
</p>
<p align="center">
<img src="img/go_to_definition_3.png">
</p>
<p align="center">
<img src="img/go_to_definition_4.png">
</p>
<p align="center">
<img src="img/go_to_definition_5.png">
</p>
<p align="center">
<img src="img/go_to_references.png">
</p>
## Commands
Please install [ripgrep](https://github.com/BurntSushi/ripgrep) to use most of commands (they are use instead of slow python code to get the list of modules, list of models, etc)
> sudo apt install ripgrep
You can automatically create Python inherit, JS component, search a view and overwrite it, etc
<p align="center">
<img src="img/demo_view.gif">
</p>
Type "Odoo" in the command palette to see what's available.
> https://youtu.be/lkYhHB83vJ8
## Auto-complete
<p align="center">
<img src="img/demo_env.gif">
</p>
## TODO
- find a way to automatically change `__manifest__.py` without reformatting
- automatically insert the python import at the right place