Code Monkey home page Code Monkey logo

vscodoosnippets's Introduction

Odoo Snippets

This extension contains predefined code snippets for Odoo developer. Snippets are available for following supported languages (file extensions):

  • Python (.py)
  • Javascript (.js)
  • XML (.xml)
  • CSV (.csv)

All snippets follow the Odoo Guidelines.

Installation

Launch VS Code. Press Ctrl+P or Command+P (for Mac). Paste command ext install jigar-patel.OdooSnippets and press Enter.

How to use?

Most snippets prefixed with oo. For example if you want to add create CRUD method then type oocreate.

Search Snippets

You can search snippets with Odoo Snippet Search command which can be run by pressing Ctrl+Shift+P or Command+Shift+P (for Mac).

Documentation

Python (.py)

Prefixed with oo
Prefix Purpose
manifest Add manifest json
import Add an import
feimport Add an import from odoo exceptions
limport Add an import from logging and create logger
fimport Add an import from
model Add model
fchar Add char field
ftext Add text field
fhtml Add html field
fboolean Add boolean field
finteger Add integer field
ffloat Add float field
fselection Add selection field
fdate Add date field
fdatetime Add dateTime field
fbinary Add binary field
fmonetary Add monetary field
fmany2one Add many2one field
fone2many Add one2many field
fmany2many Add many2many field
fcompute Add compute field
fcomputei Add compute field with inverse method
fonchange Add onchange field
fconstrains Add constrains on field (SQL/ORM)
super Add an override hook method
one Ensure one record
create Add create method
write Add write method
unlink Add unlink method

Javascript (.js)

Prefixed with oo
Prefix Purpose
define Defining a module
widget Add widget
super Add super statement
rpc Add rpc call
rpc_route Add route rpc call
dialog Add dialog widget
alert Add alert dialog
confirm Add confirm dialog

XML (.xml)

Prefix Purpose
<odoo> Add Odoo namespace
<data> Add data tag
<menuitem> Add root menu
<menuitem> Add sub menu
<form> Add form view
<list> Add list view
<kanban> Add kanban view
<search> Add search view
<calendar> Add calendar view
<cohort> Add cohort view
<gantt> Add gantt view
<graph> Add graph view
<pivot> Add pivot view
<activity> Add activity view
<qweb> Add qweb view
<viewInherit> Add inherited view
<buttonHeader> Add button in form view header
<buttonBox> Add stat button container in form view
<buttonStat> Add stat button in form view
<field> Add field tag
<filter> Add a filter to a search view
<notebook> Add a notebook
<page> Add a notebook page
<chatter> Add chatter
<action> Add an action
<actionView> Add view in action
<actionServer> Add server action
<actionUrl> Add URL action
<actionClient> Add client action
<actionReport> Add report action
<report> Add report template
<cron> Add cron job
<record> Add record
<function> Add function
<template> Add template
<templateInherit> Add inherited template
<group> Add a group tag
<xpath> Add xpath
<xpathAttr> Add xpath to attributes
<attribute> Add attribute tag for xpath
<script> Add script tag
<link> Add link tag
<assetsBackend> Add backend assets
<assetsFrontend> Add frontend assets

Qweb

Prefix Purpose
<t-if> Add if condition
<t-if-else> Add if-else condition
<t-foreach> Add foreach loop
<t-set> Add variable
<t-att> Add attribute
<t-attf> Add attribute with format value
<t-esc> Evaluate expression
<t-raw> Evaluate html content
<t-call> Call other template
<t-debug> Invokes a debugger
<t-log> Log the expression result

CSV (.csv)

Prefixed with oo
Prefix Purpose
hdr Add a header line for odoo model access file
all Add an all group access record
spec Add a specify group access record

Contributing

If you'd like to report an issue or help contribute to this visual studio code extension, please visit the repository on Github.

Thanks to all the people who already contributed!

Release Notes

Detailed release notes are available here.

License

Code licensed under MIT.

vscodoosnippets's People

Contributors

jat-odoo avatar yajo avatar nhatnm0612 avatar andriisem avatar mohitghodasara avatar crisa221 avatar pga-odoo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.