Skip to content

Features

Viet Dinh edited this page Dec 2, 2023 · 49 revisions

A more complete listing is also available in the Support Matrix.

Legend

  • 🐍 Python
  • πŸ“ XML
  • β˜• JavaScript

CLI commands

  • odoo-lsp init generates an .odoo_lsp config file for the LSP
  • odoo-lsp tsconfig generates a tsconfig.json prefilled with paths to legacy modules

Completion, definition and references for XML records

  • 🐍 *.env.ref()
  • 🐍 request.render()
  • πŸ“ inherit_id=
  • πŸ“ id= (references only)
  • πŸ“ ref=
  • πŸ“ <menuitem parent=".." />

inherit_id demo

πŸ“ Completion, definition and references for QWeb templates

  • t-inherit=, t-call=
    • No usage references yet

Completion, definition and references for models

  • 🐍 *.env[]
  • 🐍 _inherit=
  • 🐍 comodel_name for relational fields
  • 🐍 _name= (references only)
  • 🐍 Mapped access (completions, hover)
    • fields.*(related='..')
    • @api.{depends,constrains}('..')
    • Model.{mapped,sorted,create,write..}(..)
    • Fields in domains (for search, read_group etc.)

model demo

Completion and definition for model fields

  • πŸ“ name=
  • 🐍 Model.field

field demo

Browse records and models 🐍 πŸ“

  • VSCode: Ctrl+T, or Quick Open Ctrl+P and prefix with #
  • Helix: Space then Shift+S in normal mode

By default, records and models are matched by prefix, unless when the query contains a period in which case it will be parsed as a module-scoped query. For example base.view_ searches for:

  • all records whose id starts with view_ and defined in the base module; and
  • all models whose _name starts with view_

symbols demo

Clone this wiki locally