Run Odoo in VSCode using the Debug feature. Easily restart Odoo & useful arguments.

Опубликовано: 01 Март 2025
на канале: Open Source Hustle
248
6

00:00 Introduction and Prerequisites
00:53 Creating launch.json file
03:25 Running Odoo using the debug file
03:55 Beneficial Odoo arguments

launch.json content:
{
"version": "0.1.0",
"configurations": [
{
"name": "Run odoo-bin with arguments",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/odoo-bin",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "${workspaceFolder}/virtual/Scripts/python.exe"
},
"args": [
"-r", "odoo",
"-w", "odoo",
"--addons-path=${workspaceFolder}/addons,${workspaceFolder}/enterprise/odoo/addons,${workspaceFolder}/custom_addons",
"-d", "odoo_tutorial_db",
"-u", "your_custom_module",
"--dev", "xml",
]
}
]
}

Don't forget to remove the extra addons paths that you are not using and modify db name, user and password. If you get any errors then review the integrated terminal or post it in the comments.

This tutorial goes over on how to run Odoo using VSCode's debug feature. This is a convenient one time setup for developers to restart their Odoo environment after updating their custom modules.

The arguments include:
Database name, user and password.
Addons path for community version, enterprise version and custom addons path.
-u argument for updating module on restart.
And --dev argument to update xml files without restarting odoo.

You can find additional article tutorials on:
https://opensourcehustle.com/