diff --git a/README.md b/README.md index 5ad187b..eb90cd9 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,11 @@ -

-
+

- -
- VSCode Odoo Snippets -
-

- -

Develop Odoo modules faster and with no Typing Errors

+ + +

VSCode Odoo Snippets

+

Develop Odoo modules faster and with no Typing Errors

+

diff --git a/snippets/python.json b/snippets/python.json index 79fa78e..05795b3 100644 --- a/snippets/python.json +++ b/snippets/python.json @@ -4,13 +4,13 @@ "body": [ "{", "\t'name': '${1}',", - "\t'version': '${2:11.0.1.0.0}',", + "\t'version': '${2:15.0.1}',", "\t'summary': '${3}',", "\t'category': '${4}',", - "\t'author': '${5}',", + "\t'author': '${5:0fisher}',", "\t'maintainer': '${5}',", - "\t'website': '${6}',", - "\t'license': '${7}',", + "\t'website': '${6:apesoft.cn}',", + "\t'license': '${7:LGPL-3}',", "\t'contributors': [", "\t\t'${8}',", "\t],", @@ -31,15 +31,15 @@ "}", "$0" ], - "description": "Create Odoo Manifest" + "description": "Create Manifest" }, "odoo_new_model": { "prefix": "omod", "body": [ "from odoo import api, fields, models", "\n\nclass ${1:ModuleName}(models.Model):", - "\t_name = '${2:module.name}'", - "\t_description = '${3:New Description}'", + "\t_name = '${2}'", + "\t_description = '${3}'", "\n\tname = fields.Char(string='Name')", "$0" ], @@ -50,7 +50,7 @@ "body": [ "from odoo import models", "\n\nclass ${1:ModuleName}(models.Model):", - "\t_inherit = '${2:module.name}'", + "\t_inherit = '${2}'", "$0" ], "description": "Inherit Existing Odoo Model" @@ -91,7 +91,7 @@ "odoo_field_binary": { "prefix": "ofbin", "body": [ - "${1:new_field} = fields.Binary(string='${2}')", + "${1} = fields.Binary(string='${2}')", "$0" ], "description": "Add new field of type Binary" @@ -99,7 +99,7 @@ "odoo_field_boolean": { "prefix": "ofbool", "body": [ - "${1:new_field} = fields.Boolean(string='${2}')", + "${1} = fields.Boolean(string='${2}')", "$0" ], "description": "Add new field of type Boolean" @@ -107,7 +107,7 @@ "odoo_field_char": { "prefix": "ofchar", "body": [ - "${1:new_field} = fields.Char(string='${2}')", + "${1} = fields.Char(string='${2}')", "$0" ], "description": "Add new field of type Char" @@ -115,7 +115,7 @@ "odoo_field_date": { "prefix": "ofdate", "body": [ - "${1:new_field} = fields.Date(string='${2}')", + "${1} = fields.Date(string='${2}')", "$0" ], "description": "Add new field of type Date" @@ -123,7 +123,7 @@ "odoo_field_datetime": { "prefix": "oftime", "body": [ - "${1:new_field} = fields.Datetime(string='${2}')", + "${1} = fields.Datetime(string='${2}')", "$0" ], "description": "Add new field of type DateTime" @@ -131,7 +131,7 @@ "odoo_field_float": { "prefix": "offloat", "body": [ - "${1:new_field} = fields.Float(string='${2}')", + "${1} = fields.Float(string='${2}')", "$0" ], "description": "Add new field of type Float" @@ -139,7 +139,7 @@ "odoo_field_html": { "prefix": "ofhtml", "body": [ - "${1:new_field} = fields.Html(string='${2}')", + "${1} = fields.Html(string='${2}')", "$0" ], "description": "Add new field of type HTML" @@ -147,7 +147,7 @@ "odoo_field_int": { "prefix": "ofint", "body": [ - "${1:new_field} = fields.Integer(string='${2}')", + "${1} = fields.Integer(string='${2}')", "$0" ], "description": "Add new field of type Integer" @@ -155,7 +155,7 @@ "odoo_field_text": { "prefix": "oftxt", "body": [ - "${1:new_field} = fields.Text(string='${2}')", + "${1} = fields.Text(string='${2}')", "$0" ], "description": "Add new field of type Text" @@ -163,7 +163,7 @@ "odoo_field_selection": { "prefix": "ofsel", "body": [ - "${1:new_field} = fields.Selection(string='${2}', selection=[('${3}', '${4}'), ('${5}', '${6}'),])", + "${1} = fields.Selection(string='${2}', selection=[])", "$0" ], "description": "Add new field of type Selection" @@ -171,7 +171,7 @@ "odoo_field_many2one": { "prefix": "ofm2o", "body": [ - "${1:new_field} = fields.Many2one(comodel_name='${2}', string='${3}')", + "${1} = fields.Many2one(comodel_name='${2}', string='${3}')", "$0" ], "description": "Add new field of type Many2one" @@ -179,7 +179,7 @@ "odoo_field_many2many": { "prefix": "ofm2m", "body": [ - "${1:new_field} = fields.Many2many(comodel_name='${2}', string='${3}')", + "${1} = fields.Many2many(comodel_name='${2}', string='${3}')", "$0" ], "description": "Add new field of type Many2many" @@ -187,7 +187,7 @@ "odoo_field_one2many": { "prefix": "ofo2m", "body": [ - "${1:new_field} = fields.One2many(comodel_name='${2}', inverse_name='${3}', string='${4}')", + "${1} = fields.One2many(comodel_name='${2}', inverse_name='${3}', string='${4}')", "$0" ], "description": "Add new field of type One2many" @@ -196,9 +196,9 @@ "prefix": "omcreate", "body":[ "@api.model", - "def create(self, values):", - "\t# Add code here", - "\treturn super(${1:ClassName}, self).create(values)", + "def create(self, vals):", + "\t# create", + "\treturn super(${1:ClassName}, self).create(vals)", "$0" ], "description": "Add a method create" @@ -207,9 +207,9 @@ "prefix": "omwrite", "body": [ "@api.multi", - "def write(self, values):", + "def write(self, vals):", "\t# Add code here", - "\treturn super(${1:ClassName}, self).write(values)", + "\treturn super(${1:ClassName}, self).write(vals)", "$0" ], "description": "Add a method write"