vscode搭建odoo开发调试环境.md
True
vscode搭建odoo开发调试环境.md

1. 安装vscode

vscode官网

2. 安装odoo代码片段插件

Odoo Code Snippets

3. 配置调试指令

菜单->调试->打开配置->python, 将以下配置信息添加到configurations头部

已复制
  • program: 指定odoo-bin的路径,可以使用相对路径
  • args中指定配置文件路径,odoo配置参数均可写入配置文件中
  • --dev=all 指定运行为调试模式,可打断点调试
  • 若具体为某模块的开发,可用-u参数指定需要更新的模块

4.介绍

Supported Languages
This extension provide support to following languages (file extensions):
Python (.py)
XML (.xml)
Python Snippets

SnippetDescription
omanCreate Odoo Manifest
omodCreate New Odoo Model
omodiInherit Existing Odoo Model
omodtCreate Test to Odoo Model
ofbinAdd new field Binary
ofboolAdd new field Boolean
ofcharAdd new field Char
ofdateAdd new field Date
oftimeAdd new field DateTime
offloatAdd new field Float
ofhtmlAdd new field HTML
ofintAdd new field Integer
oftxtAdd new field Text
ofselAdd new field Selection
ofm2oAdd new field Many2one
ofm2mAdd new field Many2many
ofo2mAdd new field One2many
omcreateAdd a method create
omwriteAdd a method write
omcompAdd a method compute
omchangeAdd a method onchange

XML Snippets

SnippetDescription
oformCreate Form View
oformiInherit Existing Form View
otreeCreate Tree View
otreeiInherit Existing Tree View
osearchCreate Search View
osearchiInherit Existing Search View
ographCreate Graph View
ographiInherit Existing Graph View
opivotCreate Pivot View
opivotiInherit Existing Pivot View
okanbanCreate Kanban View
okanbaniInherit Existing Kanban View
ocalendarCreate Calendar View
ocalendariInherit Existing Calendar View
oganttCreate Gantt View
oganttiInherit Existing Gantt View
oxpathAdd the structure of xpath
oxpathattrAdd the structure of xpath to attributes
oactCreate new Action
onoteAdd notebook and page tags
opageAdd new page tag
omenurCreate New Menu Item in the Upper bar
omenucCreate New Menu Item for Categories
omenuaCreate New Menu Item for Actions
ocronAdd a ir.cron record (11.0 version)
obtnAdd Odoo button
obtnboxAdd Button Box on View
5.计算字段和默认值
True