From 499e87c92dc13dd85c67f0c19433f9c530e5669d Mon Sep 17 00:00:00 2001 From: Trinh Anh Ngoc Date: Wed, 26 Jul 2023 16:51:22 +0700 Subject: [PATCH] Update README.md --- README.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0ecd145..789de4e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# odoo-stubs +# 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. @@ -7,12 +7,14 @@ By using these stubs, IDEs will provide better code completion, and static type checkers will provide better reports. -These stubs should be used in conjunction with: -- [PyCharm plugin for Odoo](https://plugins.jetbrains.com/plugin/13499-odoo) -- [Visual Studio Code extension for Odoo](https://marketplace.visualstudio.com/items?itemName=trinhanhngoc.vscode-odoo) ## 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: @@ -33,13 +35,7 @@ select the project containing the Odoo source code and click `Add Content Root` #### Visual Studio Code -Create [`pyrightconfig.json`](https://microsoft.github.io/pyright/#/configuration) in the Odoo source code folder -(should be the root folder of your workspace) with something like the following example: - -```json -{ - "stubPath": "path/to/odoo-stubs" -} -``` +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). ![VSCode](images/vscode.png)