{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreieiql7zxjqrlqovkh67rlunniqryedalnejgmdqipoujiuqdwaani",
"uri": "at://did:plc:25rdn5elo5izoxrmtis34zuk/app.bsky.feed.post/3mpdpckf5xu62"
},
"coverImage": {
"$type": "blob",
"ref": {
"$link": "bafkreifbyjykhrb2cbt6cj6hxwqh6wsasy7gngqv6ztauzhs4ehmmbyg3i"
},
"mimeType": "image/webp",
"size": 63584
},
"path": "/aman_kumarsingh_b5ab1751/i-built-a-free-vs-code-extension-for-odoo-developers-4m43",
"publishedAt": "2026-06-28T09:23:16.000Z",
"site": "https://dev.to",
"tags": [
"odoo",
"python",
"opensource",
"vscode",
"Install from Marketplace",
"github.com/amankum02/odoo-snippets",
"GitHub Repository",
"@amankum02",
"Aman Kumar Singh",
"@api.depends",
"@name"
],
"textContent": "As an Odoo developer, I was tired of writing the same boilerplate code every single day.\n\nEvery time I created a new model, I had to write:\n\n\n\n from odoo import models, fields, api\n\n class MyModel(models.Model):\n _name = 'my.model'\n _description = 'My Model'\n\n name = fields.Char(string='Name', required=True)\n\n\nAnd every time I needed a form view, I had to write the entire XML structure from scratch.\n\nSo I decided to do something about it ā I built a **free VS Code extension** called **Odoo Dev Snippets**!\n\n## What is Odoo Dev Snippets?\n\nIt 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!\n\n## Python Snippets\n\nPrefix | What you get\n---|---\n`omodel` | Complete Odoo model class\n`ocompute` | Computed field with `@api.depends`\n`oonchange` | Onchange method decorator\n`om2o` | Many2one relational field\n`oo2m` | One2many relational field\n`om2m` | Many2many relational field\n`obtn` | Button action method\n`oerror` | Raise UserError\n`osearch` | Search query\n`owizard` | TransientModel wizard\n\n### Example\n\nType `omodel` + Tab:\n\n\n\n from odoo import models, fields, api\n\n class SaleOrder(models.Model):\n _name = 'sale.order'\n _description = 'Sale Order'\n\n name = fields.Char(string='Name', required=True)\n # cursor lands here ā ready to code!\n\n\nType `ocompute` + Tab:\n\n\n\n total_amount = fields.Float(\n string='Total Amount',\n compute='_compute_total_amount'\n )\n\n @api.depends('order_line')\n def _compute_total_amount(self):\n for rec in self:\n rec.total_amount = # cursor lands here\n\n\n## XML Snippets\n\nPrefix | What you get\n---|---\n`oform` | Complete form view\n`otree` | Tree / list view\n`okanban` | Kanban view\n`osearchview` | Search view with filter and group by\n`oaction` | Window action\n`omenu` | Menu item\n`obtnheader` | Header with button and statusbar\n`osmartbtn` | Smart button\n`onote` | Notebook with page tab\n`ogroup2` | Two-column group layout\n`oinherit` | View inherit with XPath\n`ochatter` | Chatter widget\n`omodulexml` | Base XML file wrapper\n\n### Example\n\nType `oform` + Tab:\n\n\n\n <record id=\"sale_order_form_view\" model=\"ir.ui.view\">\n <field name=\"name\">sale.order.form</field>\n <field name=\"model\">sale.order</field>\n <field name=\"arch\" type=\"xml\">\n <form string=\"Sale Order\">\n <sheet>\n <group>\n <field name=\"name\"/>\n <!-- cursor lands here -->\n </group>\n </sheet>\n </form>\n </field>\n </record>\n\n\nType `oinherit` + Tab:\n\n\n\n <record id=\"sale_order_form_view_inherit\" model=\"ir.ui.view\">\n <field name=\"name\">sale.order.form.inherit</field>\n <field name=\"model\">sale.order</field>\n <field name=\"inherit_id\" ref=\"sale.view_order_form\"/>\n <field name=\"arch\" type=\"xml\">\n <xpath expr=\"//field[@name='partner_id']\" position=\"after\">\n <!-- cursor lands here -->\n </xpath>\n </field>\n </record>\n\n\n## How to Install\n\n### From VS Code Marketplace\n\n 1. Open VS Code\n 2. Press `Ctrl+Shift+X`\n 3. Search **\"Odoo Dev Snippets\"**\n 4. Click **Install**\n\n\n\nš Install from Marketplace\n\n### From GitHub\n\nš github.com/amankum02/odoo-snippets\n\n## Pro Tip\n\nJust type `o` in any Python or XML file and VS Code IntelliSense will show you **all available Odoo snippets** in a dropdown!\n\n## What's Next?\n\nI am planning to add more snippets:\n\n * `__manifest__.py` template\n * Security `ir.model.access.csv` template\n * Controller routes\n * QWeb templates\n * Pivot and graph views\n\n\n\n## Contribute\n\nThis is an open source project and contributions are welcome!\n\nIf 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! š\n\nš GitHub Repository\n\n## About Me\n\nI am **Aman Kumar Singh** , an Odoo developer from India. I build open source tools to make Odoo development faster and easier.\n\n * GitHub: @amankum02\n * LinkedIn: Aman Kumar Singh\n\n\n\n_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._ š\n\n# odoo #vscode #python #opensource #webdev #programming",
"title": "I Built a Free VS Code Extension for Odoo Developers š"
}