惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
人人都是产品经理
人人都是产品经理
罗磊的独立博客
博客园 - 聂微东
雷峰网
雷峰网
量子位
美团技术团队
V
V2EX
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
The Cloudflare Blog
爱范儿
爱范儿
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
Jina AI
Jina AI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I Built a Free VS Code Extension for Odoo Developers 🐍
Aman Kumar Singh · 2026-06-28 · via DEV Community

Aman Kumar Singh

As an Odoo developer, I was tired of writing the same boilerplate code every single day.

Every time I created a new model, I had to write:

from odoo import models, fields, api

class MyModel(models.Model):
    _name = 'my.model'
    _description = 'My Model'

    name = fields.Char(string='Name', required=True)

And every time I needed a form view, I had to write the entire XML structure from scratch.

So I decided to do something about it — I built a free VS Code extension called Odoo Dev Snippets!


What is Odoo Dev Snippets?

It is a VS Code extension that provides 20+ code snippets for Odoo developers. Just type a short prefix, press Tab, and your boilerplate code is ready in seconds!


Python Snippets

Prefix What you get
omodel Complete Odoo model class
ocompute Computed field with @api.depends
oonchange Onchange method decorator
om2o Many2one relational field
oo2m One2many relational field
om2m Many2many relational field
obtn Button action method
oerror Raise UserError
osearch Search query
owizard TransientModel wizard

Example

Type omodel + Tab:

from odoo import models, fields, api

class SaleOrder(models.Model):
    _name = 'sale.order'
    _description = 'Sale Order'

    name = fields.Char(string='Name', required=True)
    # cursor lands here — ready to code!

Type ocompute + Tab:

total_amount = fields.Float(
    string='Total Amount',
    compute='_compute_total_amount'
)

@api.depends('order_line')
def _compute_total_amount(self):
    for rec in self:
        rec.total_amount = # cursor lands here


XML Snippets

Prefix What you get
oform Complete form view
otree Tree / list view
okanban Kanban view
osearchview Search view with filter and group by
oaction Window action
omenu Menu item
obtnheader Header with button and statusbar
osmartbtn Smart button
onote Notebook with page tab
ogroup2 Two-column group layout
oinherit View inherit with XPath
ochatter Chatter widget
omodulexml Base XML file wrapper

Example

Type oform + Tab:

<record id="sale_order_form_view" model="ir.ui.view">
    <field name="name">sale.order.form</field>
    <field name="model">sale.order</field>
    <field name="arch" type="xml">
        <form string="Sale Order">
            <sheet>
                <group>
                    <field name="name"/>
                    <!-- cursor lands here -->
                </group>
            </sheet>
        </form>
    </field>
</record>

Type oinherit + Tab:

<record id="sale_order_form_view_inherit" model="ir.ui.view">
    <field name="name">sale.order.form.inherit</field>
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale.view_order_form"/>
    <field name="arch" type="xml">
        <xpath expr="//field[@name='partner_id']" position="after">
            <!-- cursor lands here -->
        </xpath>
    </field>
</record>


How to Install

From VS Code Marketplace

  1. Open VS Code
  2. Press Ctrl+Shift+X
  3. Search "Odoo Dev Snippets"
  4. Click Install

🔗 Install from Marketplace

From GitHub

🔗 github.com/amankum02/odoo-snippets


Pro Tip

Just type o in any Python or XML file and VS Code IntelliSense will show you all available Odoo snippets in a dropdown!


What's Next?

I am planning to add more snippets:

  • __manifest__.py template
  • Security ir.model.access.csv template
  • Controller routes
  • QWeb templates
  • Pivot and graph views

Contribute

This is an open source project and contributions are welcome!

If you use Odoo daily and have snippets you always write — please open a PR or suggest in the issues. Let's build this together for the Odoo community! 🙌

🔗 GitHub Repository


About Me

I am Aman Kumar Singh, an Odoo developer from India. I build open source tools to make Odoo development faster and easier.


If this extension saves you even 10 minutes a day — give it a ⭐ on GitHub and a review on the Marketplace! It means a lot as a solo developer. 🙏

odoo #vscode #python #opensource #webdev #programming