Skip to content

Commit c8fdceb

Browse files
authored
Update python.json
更改自动补全内容
1 parent 5360cba commit c8fdceb

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

snippets/python.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"body": [
55
"{",
66
"\t'name': '${1}',",
7-
"\t'version': '${2:11.0.1.0.0}',",
7+
"\t'version': '${2:15.0.1}',",
88
"\t'summary': '${3}',",
99
"\t'category': '${4}',",
10-
"\t'author': '${5}',",
10+
"\t'author': '${5:0fisher}',",
1111
"\t'maintainer': '${5}',",
12-
"\t'website': '${6}',",
13-
"\t'license': '${7}',",
12+
"\t'website': '${6:apesoft.cn}',",
13+
"\t'license': '${7:LGPL-3}',",
1414
"\t'contributors': [",
1515
"\t\t'${8}',",
1616
"\t],",
@@ -31,15 +31,15 @@
3131
"}",
3232
"$0"
3333
],
34-
"description": "Create Odoo Manifest"
34+
"description": "Create Manifest"
3535
},
3636
"odoo_new_model": {
3737
"prefix": "omod",
3838
"body": [
3939
"from odoo import api, fields, models",
4040
"\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}'",
4343
"\n\tname = fields.Char(string='Name')",
4444
"$0"
4545
],
@@ -50,7 +50,7 @@
5050
"body": [
5151
"from odoo import models",
5252
"\n\nclass ${1:ModuleName}(models.Model):",
53-
"\t_inherit = '${2:module.name}'",
53+
"\t_inherit = '${2}'",
5454
"$0"
5555
],
5656
"description": "Inherit Existing Odoo Model"
@@ -91,103 +91,103 @@
9191
"odoo_field_binary": {
9292
"prefix": "ofbin",
9393
"body": [
94-
"${1:new_field} = fields.Binary(string='${2}')",
94+
"${1} = fields.Binary(string='${2}')",
9595
"$0"
9696
],
9797
"description": "Add new field of type Binary"
9898
},
9999
"odoo_field_boolean": {
100100
"prefix": "ofbool",
101101
"body": [
102-
"${1:new_field} = fields.Boolean(string='${2}')",
102+
"${1} = fields.Boolean(string='${2}')",
103103
"$0"
104104
],
105105
"description": "Add new field of type Boolean"
106106
},
107107
"odoo_field_char": {
108108
"prefix": "ofchar",
109109
"body": [
110-
"${1:new_field} = fields.Char(string='${2}')",
110+
"${1} = fields.Char(string='${2}')",
111111
"$0"
112112
],
113113
"description": "Add new field of type Char"
114114
},
115115
"odoo_field_date": {
116116
"prefix": "ofdate",
117117
"body": [
118-
"${1:new_field} = fields.Date(string='${2}')",
118+
"${1} = fields.Date(string='${2}')",
119119
"$0"
120120
],
121121
"description": "Add new field of type Date"
122122
},
123123
"odoo_field_datetime": {
124124
"prefix": "oftime",
125125
"body": [
126-
"${1:new_field} = fields.Datetime(string='${2}')",
126+
"${1} = fields.Datetime(string='${2}')",
127127
"$0"
128128
],
129129
"description": "Add new field of type DateTime"
130130
},
131131
"odoo_field_float": {
132132
"prefix": "offloat",
133133
"body": [
134-
"${1:new_field} = fields.Float(string='${2}')",
134+
"${1} = fields.Float(string='${2}')",
135135
"$0"
136136
],
137137
"description": "Add new field of type Float"
138138
},
139139
"odoo_field_html": {
140140
"prefix": "ofhtml",
141141
"body": [
142-
"${1:new_field} = fields.Html(string='${2}')",
142+
"${1} = fields.Html(string='${2}')",
143143
"$0"
144144
],
145145
"description": "Add new field of type HTML"
146146
},
147147
"odoo_field_int": {
148148
"prefix": "ofint",
149149
"body": [
150-
"${1:new_field} = fields.Integer(string='${2}')",
150+
"${1} = fields.Integer(string='${2}')",
151151
"$0"
152152
],
153153
"description": "Add new field of type Integer"
154154
},
155155
"odoo_field_text": {
156156
"prefix": "oftxt",
157157
"body": [
158-
"${1:new_field} = fields.Text(string='${2}')",
158+
"${1} = fields.Text(string='${2}')",
159159
"$0"
160160
],
161161
"description": "Add new field of type Text"
162162
},
163163
"odoo_field_selection": {
164164
"prefix": "ofsel",
165165
"body": [
166-
"${1:new_field} = fields.Selection(string='${2}', selection=[('${3}', '${4}'), ('${5}', '${6}'),])",
166+
"${1} = fields.Selection(string='${2}', selection=[])",
167167
"$0"
168168
],
169169
"description": "Add new field of type Selection"
170170
},
171171
"odoo_field_many2one": {
172172
"prefix": "ofm2o",
173173
"body": [
174-
"${1:new_field} = fields.Many2one(comodel_name='${2}', string='${3}')",
174+
"${1} = fields.Many2one(comodel_name='${2}', string='${3}')",
175175
"$0"
176176
],
177177
"description": "Add new field of type Many2one"
178178
},
179179
"odoo_field_many2many": {
180180
"prefix": "ofm2m",
181181
"body": [
182-
"${1:new_field} = fields.Many2many(comodel_name='${2}', string='${3}')",
182+
"${1} = fields.Many2many(comodel_name='${2}', string='${3}')",
183183
"$0"
184184
],
185185
"description": "Add new field of type Many2many"
186186
},
187187
"odoo_field_one2many": {
188188
"prefix": "ofo2m",
189189
"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}')",
191191
"$0"
192192
],
193193
"description": "Add new field of type One2many"
@@ -196,9 +196,9 @@
196196
"prefix": "omcreate",
197197
"body":[
198198
"@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)",
202202
"$0"
203203
],
204204
"description": "Add a method create"
@@ -207,9 +207,9 @@
207207
"prefix": "omwrite",
208208
"body": [
209209
"@api.multi",
210-
"def write(self, values):",
210+
"def write(self, vals):",
211211
"\t# Add code here",
212-
"\treturn super(${1:ClassName}, self).write(values)",
212+
"\treturn super(${1:ClassName}, self).write(vals)",
213213
"$0"
214214
],
215215
"description": "Add a method write"

0 commit comments

Comments
 (0)