Skip to content

Context-aware suggestions ​

As you type, Assista IDE suggests the model, field, method and template names that exist in your project, and lets you jump to their definitions. The suggestions come from an index of your workspace and follow your Odoo version, so you make fewer typos and spend less time searching.

These features come from the bundled Odoo Helper and support Odoo 18, 19 and 20.

What you can do ​

  • Complete names from your project: models, fields, methods, XML IDs, templates, widgets and CSS classes.
  • Follow relations: after self.partner_id. you get the fields of res.partner.
  • Jump to definitions from XML to Python and between Python files.
  • Complete manifest paths for depends, data, demo and assets.
  • Get version-correct tags and attributes in XML.
  • Override inherited methods with a super() call already in place.

Get started ​

  1. Open a folder that contains Odoo modules. Suggestions are active when the workspace has a __manifest__.py or an odoo/release.py.
  2. Wait a few seconds after the window opens. The workspace is indexed in the background, and suggestions that depend on the index appear when it is ready. Indexing shows no progress bar. Later opens reuse the saved index and only read changed files.
  3. Start typing. Suggestions appear on their own. Press Ctrl+Space to open them again, Tab or Enter to accept one and Esc to close the list.

Check the Odoo version in the status bar, for example Odoo v20 (Auto). Select it to change the version. See Create modules and files.

TIP

Add the Odoo source folder, the one that contains odoo/ and addons/, to your workspace so core models, fields and templates are suggested too.

Python suggestions ​

Items marked index need the workspace index to be ready.

You typeYou get
fields.The field classes of your Odoo version, such as Char, Many2one and Properties, inserted as Char(string="...").
= inside a fields.X(...) callThe parameters that field accepts in your version, such as string, required, compute, ondelete and tracking.
@The api decorators of your version, such as api.depends, api.constrains, api.onchange and api.model_create_multi.
fields.Many2one(', One2many, Many2many or comodel_name='Model names. index
_inherit = ' as a string, list or tupleModel names. index
self.env['Model names. index
fields.One2many('model', ' or inverse_name='The Many2one fields of that model that point back to the current model. index
self. or record. in a loop such as for record in selfThe fields of the current model, and through relations. index
@api.depends(' or @api.onchange('The fields of the current model. index
def _compute_, def _inverse_ or def _search_The field names of the current class, to complete the method name.
def in a class with _inheritThe methods of the inherited model. Choosing one inserts the override with a super() call. index
odooThe Python snippets, including the import snippets.

Follow relations ​

A chain of relational fields keeps going as deep as you write it. The suggestions are the fields of the last model in the chain.

python
class PurchaseOrder(models.Model):
    _name = 'purchase.order'
    order_line_ids = fields.One2many('purchase.order.line', 'order_id')

class PurchaseOrderLine(models.Model):
    _name = 'purchase.order.line'
    product_id = fields.Many2one('product.product')

# Inside a method of purchase.order:
self.order_line_ids.product_id.   # suggests the fields of product.product

If a field in the chain is not a relation, the suggestions stop there.

XML suggestions ​

Where the cursor isYou get
After <The tags of your Odoo version: data tags such as record, field, menuitem and template, every view type (form, list, kanban, card on Odoo 20, search, calendar, graph, pivot, activity, hierarchy), view elements and QWeb t.
Inside a tagOnly the attributes that tag accepts in your version, for example card_id and dialog_size on Odoo 20.
<field name=" or <filter name=" in a viewThe fields of the view's model, taken from the model field of the view record. This works in every view type. index
<button name=" with type="object"The methods of the view's model. index
<record model="Model names. index
The text of <field name="model"> in a view, or <field name="res_model"> in a window actionModel names. index
The text of <field name="view_mode">list, form, kanban, pivot, graph, calendar, activity and hierarchy.
The text of <field name="tag"> in an ir.actions.client recordThe client action tags registered in JavaScript. index
widget=" on a fieldThe field widgets registered in JavaScript, with their module. index
t-call="QWeb template IDs. index
t-component=" or <owl-component name="Public components. index
position=" on <xpath>after, before, inside, replace and attributes.
class="CSS classes, starting with the current module, then web, base, mail and portal, then the rest. index
odooThe XML snippets.

Manifest suggestions ​

In __manifest__.py:

  • depends: when you open a quote on a line that contains depends, you get the module names in your workspace. index
  • data, demo and assets paths: you get the module's files and folders as you type a path. Choosing a folder continues into it. Asset paths start with the module name, for example my_module/static/src/..., as Odoo expects.

Go to definition ​

Press F12 or Ctrl+Click (Cmd+Click on macOS) on a name to jump to where it is defined. Use Alt+F12 to peek at the definition without leaving the file. When a name has several definitions, you get a list.

From XML

OnGoes to
<field name="..."> or <filter name="..."> in a viewThe field in Python.
<button name="..." type="object">The Python method.
model="...", <field name="model"> or <field name="res_model">The model class.
ref="...", inherit_id="...", parent="..." or action="..."The XML record, menu item or template with that ID.
t-call="..." or t-name="..."The QWeb template.
widget="..."The JavaScript registration of the widget.
<field name="tag"> in a client actionThe JavaScript registration of the action.
A class in class="..."Its CSS or SCSS definition in the current module, web or mail. Needs advanced CSS indexing.

From Python

OnGoes to
A model name in _inheritThe definitions of the model.
self.env['model.name']The model class.
self.field_name or self.partner_id.nameThe field or method, following relations.
related='partner_id.country_id'The field at the end of the chain.
A module name in the manifest dependsThat module's __manifest__.py.
A path in the manifest data, demo or assetsThe file, or the folder in the Explorer.

Settings ​

Open Settings and search for cybrosys-assista-odoo-helper. Each setting below starts with cybrosys-assista-odoo-helper..

SettingDefaultUse it to
odooSourcePathEmptyPoint to the Odoo source folder, the one with odoo/release.py, when it is not in your workspace. It helps version detection and the CSS class suggestions.
indexing.enableAdvanceCSSIndexingOffTurn on go to definition for CSS classes.
indexing.enableCoreIndexingOnIndex Python models, fields and methods. Most suggestions and navigation need it.
indexing.enableRegistryIndexingOnIndex JavaScript registries, for widget, client action and public component suggestions.
indexing.enableCSSIndexingOnIndex CSS and SCSS classes, for class=" suggestions.

Turn off indexing you do not use to speed up very large workspaces.

Troubleshooting ​

  • No suggestions at all. Check that the folder you opened contains a __manifest__.py or an odoo/release.py, and that the status bar shows an Odoo version.
  • Model or field names are missing. Wait for the first index to finish. If the index looks outdated, run Assista: Remove Index Data (Clear Cache) from the Command Palette, then reload the window to rebuild it.

Tips and limits ​

  • Go to definition works from XML and Python files, not from JavaScript.
  • Inside an <xpath> of an inherited view, field suggestions use the view record rather than the inherited view's model.
  • Suggestions for depends appear on lines that contain the word depends.

Next steps ​

Built by Cybrosys Technologies.