npx skills add https://github.com/mindrally/skills --skill odoo-development您是一位精通 Python、Odoo 和企业级业务应用开发的专家。
__manifest__.py 文件models.Model 的模型@api.model 用于模型级方法@api.multi 用于记录集方法@api.depends 用于计算字段@api.onchange 用于 UI 字段变更广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
<xpath> 和 <field> 使用 XML 继承进行修改@http.route 实现控制器以处理 HTTP 端点ValidationError、UserError)@api.constrains 强制执行约束_logger)_() 标记可翻译字符串module_name/
├── __init__.py
├── __manifest__.py
├── models/
│ ├── __init__.py
│ └── model_name.py
├── views/
│ └── model_name_views.xml
├── security/
│ ├── ir.model.access.csv
│ └── security_rules.xml
├── data/
│ └── data.xml
├── controllers/
│ ├── __init__.py
│ └── main.py
├── static/
│ └── src/
├── wizards/
│ ├── __init__.py
│ └── wizard_name.py
└── reports/
└── report_templates.xml
from odoo import models, fields, api
from odoo.exceptions import ValidationError
class CustomModel(models.Model):
_name = 'custom.model'
_description = 'Custom Model'
name = fields.Char(string='名称', required=True)
active = fields.Boolean(default=True)
state = fields.Selection([
('draft', '草稿'),
('confirmed', '已确认'),
], default='draft')
@api.depends('name')
def _compute_display_name(self):
for record in self:
record.display_name = record.name
@api.constrains('name')
def _check_name(self):
for record in self:
if len(record.name) < 3:
raise ValidationError("名称必须至少包含 3 个字符")
<record id="custom_model_form" model="ir.ui.view">
<field name="name">custom.model.form</field>
<field name="model">custom.model</field>
<field name="arch" type="xml">
<form>
<header>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group>
<field name="name"/>
<field name="active"/>
</group>
</sheet>
</form>
</field>
</record>
每周安装量
505
代码仓库
GitHub 星标数
42
首次出现
Jan 25, 2026
安全审计
安装于
opencode444
gemini-cli441
codex431
github-copilot425
kimi-cli392
amp391
You are an expert in Python, Odoo, and enterprise business application development.
__manifest__.py filesmodels.Model@api.model for model-level methods@api.multi for recordset methods@api.depends for computed fields@api.onchange for UI field changes<xpath> and <field> for modifications@http.route for HTTP endpointsValidationError, UserError)@api.constrains_logger)_()module_name/
├── __init__.py
├── __manifest__.py
├── models/
│ ├── __init__.py
│ └── model_name.py
├── views/
│ └── model_name_views.xml
├── security/
│ ├── ir.model.access.csv
│ └── security_rules.xml
├── data/
│ └── data.xml
├── controllers/
│ ├── __init__.py
│ └── main.py
├── static/
│ └── src/
├── wizards/
│ ├── __init__.py
│ └── wizard_name.py
└── reports/
└── report_templates.xml
from odoo import models, fields, api
from odoo.exceptions import ValidationError
class CustomModel(models.Model):
_name = 'custom.model'
_description = 'Custom Model'
name = fields.Char(string='Name', required=True)
active = fields.Boolean(default=True)
state = fields.Selection([
('draft', 'Draft'),
('confirmed', 'Confirmed'),
], default='draft')
@api.depends('name')
def _compute_display_name(self):
for record in self:
record.display_name = record.name
@api.constrains('name')
def _check_name(self):
for record in self:
if len(record.name) < 3:
raise ValidationError("Name must be at least 3 characters")
<record id="custom_model_form" model="ir.ui.view">
<field name="name">custom.model.form</field>
<field name="model">custom.model</field>
<field name="arch" type="xml">
<form>
<header>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group>
<field name="name"/>
<field name="active"/>
</group>
</sheet>
</form>
</field>
</record>
Weekly Installs
505
Repository
GitHub Stars
42
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode444
gemini-cli441
codex431
github-copilot425
kimi-cli392
amp391
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
140,500 周安装