|
4 | 4 | "body": [
|
5 | 5 | "{",
|
6 | 6 | "\t'name': '${1}',",
|
7 |
| - "\t'version': '${2:11.0.1.0.0}',", |
| 7 | + "\t'version': '${2:15.0.1}',", |
8 | 8 | "\t'summary': '${3}',",
|
9 | 9 | "\t'category': '${4}',",
|
10 |
| - "\t'author': '${5}',", |
| 10 | + "\t'author': '${5:0fisher}',", |
11 | 11 | "\t'maintainer': '${5}',",
|
12 |
| - "\t'website': '${6}',", |
13 |
| - "\t'license': '${7}',", |
| 12 | + "\t'website': '${6:apesoft.cn}',", |
| 13 | + "\t'license': '${7:LGPL-3}',", |
14 | 14 | "\t'contributors': [",
|
15 | 15 | "\t\t'${8}',",
|
16 | 16 | "\t],",
|
|
31 | 31 | "}",
|
32 | 32 | "$0"
|
33 | 33 | ],
|
34 |
| - "description": "Create Odoo Manifest" |
| 34 | + "description": "Create Manifest" |
35 | 35 | },
|
36 | 36 | "odoo_new_model": {
|
37 | 37 | "prefix": "omod",
|
38 | 38 | "body": [
|
39 | 39 | "from odoo import api, fields, models",
|
40 | 40 | "\n\nclass ${1:ModuleName}(models.Model):",
|
41 |
| - "\t_name = '${2:module.name}'", |
42 |
| - "\t_description = '${3:New Description}'", |
| 41 | + "\t_name = '${2}'", |
| 42 | + "\t_description = '${3}'", |
43 | 43 | "\n\tname = fields.Char(string='Name')",
|
44 | 44 | "$0"
|
45 | 45 | ],
|
|
50 | 50 | "body": [
|
51 | 51 | "from odoo import models",
|
52 | 52 | "\n\nclass ${1:ModuleName}(models.Model):",
|
53 |
| - "\t_inherit = '${2:module.name}'", |
| 53 | + "\t_inherit = '${2}'", |
54 | 54 | "$0"
|
55 | 55 | ],
|
56 | 56 | "description": "Inherit Existing Odoo Model"
|
|
91 | 91 | "odoo_field_binary": {
|
92 | 92 | "prefix": "ofbin",
|
93 | 93 | "body": [
|
94 |
| - "${1:new_field} = fields.Binary(string='${2}')", |
| 94 | + "${1} = fields.Binary(string='${2}')", |
95 | 95 | "$0"
|
96 | 96 | ],
|
97 | 97 | "description": "Add new field of type Binary"
|
98 | 98 | },
|
99 | 99 | "odoo_field_boolean": {
|
100 | 100 | "prefix": "ofbool",
|
101 | 101 | "body": [
|
102 |
| - "${1:new_field} = fields.Boolean(string='${2}')", |
| 102 | + "${1} = fields.Boolean(string='${2}')", |
103 | 103 | "$0"
|
104 | 104 | ],
|
105 | 105 | "description": "Add new field of type Boolean"
|
106 | 106 | },
|
107 | 107 | "odoo_field_char": {
|
108 | 108 | "prefix": "ofchar",
|
109 | 109 | "body": [
|
110 |
| - "${1:new_field} = fields.Char(string='${2}')", |
| 110 | + "${1} = fields.Char(string='${2}')", |
111 | 111 | "$0"
|
112 | 112 | ],
|
113 | 113 | "description": "Add new field of type Char"
|
114 | 114 | },
|
115 | 115 | "odoo_field_date": {
|
116 | 116 | "prefix": "ofdate",
|
117 | 117 | "body": [
|
118 |
| - "${1:new_field} = fields.Date(string='${2}')", |
| 118 | + "${1} = fields.Date(string='${2}')", |
119 | 119 | "$0"
|
120 | 120 | ],
|
121 | 121 | "description": "Add new field of type Date"
|
122 | 122 | },
|
123 | 123 | "odoo_field_datetime": {
|
124 | 124 | "prefix": "oftime",
|
125 | 125 | "body": [
|
126 |
| - "${1:new_field} = fields.Datetime(string='${2}')", |
| 126 | + "${1} = fields.Datetime(string='${2}')", |
127 | 127 | "$0"
|
128 | 128 | ],
|
129 | 129 | "description": "Add new field of type DateTime"
|
130 | 130 | },
|
131 | 131 | "odoo_field_float": {
|
132 | 132 | "prefix": "offloat",
|
133 | 133 | "body": [
|
134 |
| - "${1:new_field} = fields.Float(string='${2}')", |
| 134 | + "${1} = fields.Float(string='${2}')", |
135 | 135 | "$0"
|
136 | 136 | ],
|
137 | 137 | "description": "Add new field of type Float"
|
138 | 138 | },
|
139 | 139 | "odoo_field_html": {
|
140 | 140 | "prefix": "ofhtml",
|
141 | 141 | "body": [
|
142 |
| - "${1:new_field} = fields.Html(string='${2}')", |
| 142 | + "${1} = fields.Html(string='${2}')", |
143 | 143 | "$0"
|
144 | 144 | ],
|
145 | 145 | "description": "Add new field of type HTML"
|
146 | 146 | },
|
147 | 147 | "odoo_field_int": {
|
148 | 148 | "prefix": "ofint",
|
149 | 149 | "body": [
|
150 |
| - "${1:new_field} = fields.Integer(string='${2}')", |
| 150 | + "${1} = fields.Integer(string='${2}')", |
151 | 151 | "$0"
|
152 | 152 | ],
|
153 | 153 | "description": "Add new field of type Integer"
|
154 | 154 | },
|
155 | 155 | "odoo_field_text": {
|
156 | 156 | "prefix": "oftxt",
|
157 | 157 | "body": [
|
158 |
| - "${1:new_field} = fields.Text(string='${2}')", |
| 158 | + "${1} = fields.Text(string='${2}')", |
159 | 159 | "$0"
|
160 | 160 | ],
|
161 | 161 | "description": "Add new field of type Text"
|
162 | 162 | },
|
163 | 163 | "odoo_field_selection": {
|
164 | 164 | "prefix": "ofsel",
|
165 | 165 | "body": [
|
166 |
| - "${1:new_field} = fields.Selection(string='${2}', selection=[('${3}', '${4}'), ('${5}', '${6}'),])", |
| 166 | + "${1} = fields.Selection(string='${2}', selection=[])", |
167 | 167 | "$0"
|
168 | 168 | ],
|
169 | 169 | "description": "Add new field of type Selection"
|
170 | 170 | },
|
171 | 171 | "odoo_field_many2one": {
|
172 | 172 | "prefix": "ofm2o",
|
173 | 173 | "body": [
|
174 |
| - "${1:new_field} = fields.Many2one(comodel_name='${2}', string='${3}')", |
| 174 | + "${1} = fields.Many2one(comodel_name='${2}', string='${3}')", |
175 | 175 | "$0"
|
176 | 176 | ],
|
177 | 177 | "description": "Add new field of type Many2one"
|
178 | 178 | },
|
179 | 179 | "odoo_field_many2many": {
|
180 | 180 | "prefix": "ofm2m",
|
181 | 181 | "body": [
|
182 |
| - "${1:new_field} = fields.Many2many(comodel_name='${2}', string='${3}')", |
| 182 | + "${1} = fields.Many2many(comodel_name='${2}', string='${3}')", |
183 | 183 | "$0"
|
184 | 184 | ],
|
185 | 185 | "description": "Add new field of type Many2many"
|
186 | 186 | },
|
187 | 187 | "odoo_field_one2many": {
|
188 | 188 | "prefix": "ofo2m",
|
189 | 189 | "body": [
|
190 |
| - "${1:new_field} = fields.One2many(comodel_name='${2}', inverse_name='${3}', string='${4}')", |
| 190 | + "${1} = fields.One2many(comodel_name='${2}', inverse_name='${3}', string='${4}')", |
191 | 191 | "$0"
|
192 | 192 | ],
|
193 | 193 | "description": "Add new field of type One2many"
|
|
196 | 196 | "prefix": "omcreate",
|
197 | 197 | "body":[
|
198 | 198 | "@api.model",
|
199 |
| - "def create(self, values):", |
200 |
| - "\t# Add code here", |
201 |
| - "\treturn super(${1:ClassName}, self).create(values)", |
| 199 | + "def create(self, vals):", |
| 200 | + "\t# create", |
| 201 | + "\treturn super(${1:ClassName}, self).create(vals)", |
202 | 202 | "$0"
|
203 | 203 | ],
|
204 | 204 | "description": "Add a method create"
|
|
207 | 207 | "prefix": "omwrite",
|
208 | 208 | "body": [
|
209 | 209 | "@api.multi",
|
210 |
| - "def write(self, values):", |
| 210 | + "def write(self, vals):", |
211 | 211 | "\t# Add code here",
|
212 |
| - "\treturn super(${1:ClassName}, self).write(values)", |
| 212 | + "\treturn super(${1:ClassName}, self).write(vals)", |
213 | 213 | "$0"
|
214 | 214 | ],
|
215 | 215 | "description": "Add a method write"
|
|
0 commit comments