Skip to content

Instantly share code, notes, and snippets.

@tong-odoo
Last active September 23, 2024 07:40
Show Gist options
  • Select an option

  • Save tong-odoo/65ada019bd83ca8f4cb64c10573cbbc5 to your computer and use it in GitHub Desktop.

Select an option

Save tong-odoo/65ada019bd83ca8f4cb64c10573cbbc5 to your computer and use it in GitHub Desktop.
VSCode Settings
{
"folders": [
{
"name": "custom",
"path": ".."
},
{
"name": "odoo",
"path": "../../../../odoo/17.0"
},
{
"name": "playground",
"path": "../../../odoo-tong/playground/veracross"
}
],
"settings": {
"python.languageServer": "None",
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#fbed80",
"activityBar.background": "#fbed80",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#06b9a5",
"activityBarBadge.foreground": "#15202b",
"commandCenter.border": "#15202b99",
"sash.hoverBorder": "#fbed80",
"statusBar.background": "#f9e64f",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#f7df1e",
"statusBarItem.remoteBackground": "#f9e64f",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#f9e64f",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#f9e64f99",
"titleBar.inactiveForeground": "#15202b99"
},
"peacock.color": "#f9e64f",
"python.analysis.extraPaths": [
"/home/odoo/Desktop/odev/odoo/17.0/odoo",
"/home/odoo/Desktop/odev/odoo/17.0/enterprise",
"/home/odoo/Desktop/odev/odoo/17.0/venv/lib/python3.10/site-packages"
],
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true,
"**/lib": true,
},
"search.useIgnoreFiles": true,
"files.exclude": {
// "**/.**": true,
"**/CVS": true,
"**/*.svg": true,
"**/Thumbs.db": true,
"**/i18n": true,
"**/i18n_extra": true,
"**/design-themes": true,
"**/types": true,
"**/LICENSE": true,
"**/COPYRIGHT": true,
"**/CONTRIBUTING.md": true,
"**/MANIFEST.in": true,
"**/SECURITY.md": true,
"**/setup.cfg": true,
},
},
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "drop database",
"command": "dropdb ${input:dbName} || echo 0",
"type": "shell",
"group": "build",
"presentation": {
"close": true
}
},
{
"label": "copy database from template",
"command": "createdb ${input:dbName} -T ${input:dbTemplate} || echo 0",
"type": "shell",
"group": "build",
"presentation": {
"close": true
},
},
{
"label": "init database",
"type": "shell",
"command": "${workspaceFolder:odoo}/venv/bin/python3",
"args": [
"${workspaceFolder:odoo}/odoo/odoo-bin",
"--addons-path",
"${workspaceFolder:odoo}/odoo/addons,${workspaceFolder:odoo}/enterprise,${workspaceFolder:odoo}/design-themes,${workspaceFolder:custom}",
"-d",
"${input:dbName}",
"-i",
"${input:moduleName}",
"--stop-after-init",
],
"group": "build",
"dependsOrder": "sequence",
"dependsOn": [
"drop database",
"copy database from template"
],
"presentation": {
"close": true
}
},
],
"inputs": [
{
"id": "dbName",
"type": "command",
"command": "extension.commandvariable.promptStringRemember",
"args": {
"key": "DatabaseName",
"description": "Enter the database name:"
}
},
{
"id": "dbTemplate",
"type": "command",
"command": "extension.commandvariable.promptStringRemember",
"args": {
"key": "DatabaseTemplateName",
"description": "Enter the database template name:"
}
},
{
"id": "moduleName",
"type": "command",
"command": "extension.commandvariable.promptStringRemember",
"args": {
"key": "ModuleName",
"description": "Enter the module name:"
}
},
]
},
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "Run locally",
"type": "debugpy",
"request": "launch",
"stopOnEntry": false,
"python": "${workspaceFolder:odoo}/venv/bin/python3",
"program": "${workspaceFolder:odoo}/odoo/odoo-bin",
"args": [
"--addons-path",
"${workspaceFolder:odoo}/odoo/addons,${workspaceFolder:odoo}/enterprise,${workspaceFolder:odoo}/design-themes,${workspaceFolder:custom}",
"-d",
"${input:dbName}",
"-i",
"${input:moduleName}",
],
"cwd": "${workspaceFolder:odoo}",
"console": "integratedTerminal",
},
{
"name": "Unit test",
"type": "debugpy",
"request": "launch",
"stopOnEntry": false,
"python": "${workspaceFolder:odoo}/venv/bin/python3",
"program": "${workspaceFolder:odoo}/odoo/odoo-bin",
"args": [
"--addons-path",
"${workspaceFolder:odoo}/odoo/addons,${workspaceFolder:odoo}/enterprise,${workspaceFolder:odoo}/design-themes,${workspaceFolder:custom}",
"-d",
"${input:dbName}",
"--test-tags",
":TestExpensesAccessRights.test_expense_sheet_access_rights",
],
// "preLaunchTask": "init database",
"cwd": "${workspaceFolder:odoo}",
"console": "integratedTerminal",
},
],
"inputs": [
{
"id": "dbName",
"type": "command",
"command": "extension.commandvariable.promptStringRemember",
"args": {
"key": "DatabaseName",
"description": "Enter the database name:"
}
},
{
"id": "moduleName",
"type": "command",
"command": "extension.commandvariable.promptStringRemember",
"args": {
"key": "ModuleName",
"description": "Enter the module name:"
}
},
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment