https://github.com/odoo-ide/odoo-stubs
Python Stubs for Odoo
https://github.com/odoo-ide/odoo-stubs
odoo pep484 python stub types typing
Last synced: 6 months ago
JSON representation
Python Stubs for Odoo
- Host: GitHub
- URL: https://github.com/odoo-ide/odoo-stubs
- Owner: odoo-ide
- License: gpl-3.0
- Created: 2019-12-08T15:24:56.000Z (almost 6 years ago)
- Default Branch: 18.0
- Last Pushed: 2025-03-26T09:36:19.000Z (6 months ago)
- Last Synced: 2025-03-29T12:36:10.528Z (6 months ago)
- Topics: odoo, pep484, python, stub, types, typing
- Language: Python
- Homepage:
- Size: 1.67 MB
- Stars: 76
- Watchers: 6
- Forks: 40
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Odoo Stubs
> A stub file is a file containing a skeleton of the public interface of that Python module,
> including classes, variables, functions – and most importantly, their types.
>
> https://mypy.readthedocs.io/en/stable/stubs.htmlBy using these stubs, IDEs will provide better code completion,
and static type checkers will provide better reports.## Usage
If you are using the [PyCharm plugin for Odoo](https://plugins.jetbrains.com/plugin/13499-odoo) or
the [VSCode extension for Odoo](https://marketplace.visualstudio.com/items?itemName=trinhanhngoc.vscode-odoo),
then you don't need to setup Odoo Stubs manually as they already have built-in Odoo Stubs.
If not, you can follow these instructions for manually setup.### 1. Clone the branch corresponding to the Odoo version
Example, for Odoo 16:
```
git clone -b 16.0 https://github.com/odoo-ide/odoo-stubs.git odoo-stubs16
```### 2. Configure IDEs
#### PyCharm
First make sure you have attached the [Odoo source code](https://github.com/odoo/odoo)
to your project.
Then open `Settings > Project > Project Structure`,
select the project containing the Odoo source code and click `Add Content Root` to add the odoo-stubs folder.
#### Visual Studio Code
Add the odoo-stubs folder to the `stubPath` or `extraPaths` settings as described in the
[import resolution documentation](https://microsoft.github.io/pyright/#/import-resolution).