-
Notifications
You must be signed in to change notification settings - Fork 0
/
xml.json
189 lines (189 loc) · 5.41 KB
/
xml.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
{
"Odoo tag": {
"prefix": "odoo",
"body": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>",
"<odoo>",
"\t$0",
"</odoo>",
""
]
},
"Menu Item": {
"prefix": "menuitem",
"body": [
"<menuitem",
"\tid=\"$1_menu\"",
"\tname=\"$2\"",
"/>$0",
]
},
"odoo_record_view": {
"prefix": "recordView",
"body": [
"<record id=\"$1_view_$2\" model=\"ir.ui.view\">",
"\t<field name=\"name\">${TM_FILEPATH/.*\\/(\\w+)\\/views.*/${1}/}.$1.$2</field>",
"\t<field name=\"model\">${TM_FILEPATH/.*\\/(\\w+)\\/views.*/${1}/}.$1</field>$0",
"</record>"
],
"description": "Create a Record View"
},
"odoo_record_action": {
"prefix": "recordAction",
"body": [
"<record id=\"${1}_action\" model=\"ir.actions.act_window\">",
"\t<field name=\"name\">${1/(.*)/${1:/capitalize}/}</field>",
"\t<field name=\"res_model\">${TM_FILEPATH/.*\\/(\\w+)\\/views.*/${1}/}.${1}</field>",
"\t<field name=\"view_mode\">${2|form,tree|}$0</field>",
"</record>"
],
"description": "Create a Record Action"
},
"odoo_record_data": {
"prefix": "recordData",
"body": [
"<record id=\"${TM_FILENAME_BASE}_${1}\" model=\"${TM_FILEPATH/.*\\/(\\w+)\\/demo\\/.*/${1}/}.${3}\">",
"\t<field name=\"${4}\">${5}</field>$0",
"</record>"
],
"description": "Create a record with data (like demo data for example)."
},
"odoo_record_group": {
"prefix": "recordGroup",
"body": [
"<record id=\"group_$1\" model=\"res.groups\">",
"\t<field name=\"name\">$2</field>",
"\t<field name=\"category_id\" ref=\"${TM_FILEPATH/.*\\/(\\w+)\\/security\\/.*/${1}/}.${3}\"/>",
"\t<field name=\"implied_ids\" eval=\"[(6,0,[ref('$4')])]\"/>",
"</record>"
],
"description": "Create a record for define a group"
},
"odoo_record_module_category": {
"prefix": "recordModuleCategory",
"body": [
"<record id=\"module_category_$1\" model=\"ir.module.category\">",
"\t<field name=\"name\">$1</field>",
"</record>$0",
]
},
"odoo_record_rule": {
"prefix": "recordRule",
"body": [
"<record id=\"$1\" model=\"ir.rule\">",
"\t<field name=\"name\">$2</field>",
"\t<field name=\"model_id\" ref=\"model_${TM_FILEPATH/.*\\/(\\w+)\\/security\\/.*/${1}/}_$3\"/>",
"\t<field name=\"groups\" eval=\"[(4, ref('${TM_FILEPATH/.*\\/(\\w+)\\/security\\/.*/${1}/}.$4'))]\"/>",
"\t<field name=\"perm_read\" eval=\"${5|0,1|}\"/>",
"\t<field name=\"perm_create\" eval=\"${6|0,1|}\"/>",
"\t<field name=\"perm_write\" eval=\"${7|0,1|}\"/>",
"\t<field name=\"perm_unlink\" eval=\"${8|0,1|}\"/>",
"\t<field name=\"domain_force\">",
"\t\t[($9, $10, $11)]",
"\t</field>",
"</record>$0"
],
},
"odoo_report": {
"prefix": "oreport",
"body": [
"<report",
"\tid=\"report_$1\"",
"\tmodel=\"${TM_FILEPATH/.*\\/(\\w+)\\/report\\/.*/${1}/}.$1\"",
"\tstring=\"${2:Report }${1/(.*)/${1:/capitalize}/}\"",
"\tname=\"${TM_FILEPATH/.*\\/(\\w+)\\/report\\/.*/${1}/}.report_$1_view\"",
"\tfile=\"${TM_FILEPATH/.*\\/(\\w+)\\/report\\/.*/${1}/}.report_$1\"",
"\treport_type=\"qweb-pdf\" />"
],
"description": ""
},
"Field Arch": {
"prefix": "farch",
"body": [
"<field name=\"arch\" type=\"xml\">",
"\t<${1|form,pivot,search,tree|}>",
"\t\t$0",
"\t</$1>",
"</field>"
]
},
"odoo_field_tag_autoclosing": {
"prefix": "tfield",
"body": "<field name=\"$1\"/>$0",
"description": "Autoclosing field tag"
},
"odoo_field_tag": {
"prefix": "tfield",
"body": "<field name=\"$1\">$2</field>$0",
"description": "Field tag"
},
"odoo_filter_tag": {
"prefix": "tfilter",
"body": "<filter name=\"$1\" string=\"$2\" domain=\"[$3]\"/>$0",
"description": "A filter is a predefined toggle in the search view, it can only be enabled or disabled. Its main purposes are to add data to the search context (the context passed to the data view for searching/filtering), or to append new sections to the search filter."
},
"odoo_group_tag": {
"prefix": "tgroup",
"body": [
"<group>",
"\t$0",
"</group>"
]
},
"odoo_page_tag": {
"prefix": "tpage",
"body": [
"<page>",
"\t$0",
"</page>"
]
},
"odoo_sheet_tag": {
"prefix": "tsheet",
"body": [
"<sheet>",
"\t$0",
"</sheet>"
]
},
"odoo_action_attribute": {
"prefix": "action",
"body": "action=\"$1_action\"$0",
"description": "Load an execute an ir.actions, the button’s name is the database id of the action. The context is expanded with the list’s model (as active_model), the current row’s record (active_id) and all the records currently loaded in the list (active_ids, may be just a subset of the database records matching the current search)."
},
"odoo_readonly_attribute": {
"prefix": "readonly",
"body": "readonly=\"${1|1,0|}\"$0"
},
"Widget Attribute": {
"prefix": "attrWidget",
"body": "widget=\"${1|float_time,email,handle,image,mail_followers,mail_thread,many2many_tags,many2onebutton,progressbar,statusbar|}\"$0",
"description": "Alternate representations for a field’s display."
},
"web_icon_attribute": {
"prefix": "webicon",
"body": "web_icon=\"${TM_FILEPATH/.*\\/(\\w+)\\/views.*/${1}/},${2:static/description/icon}.${3|jpg,png|}\"$0",
"description": "Add an icon to your application."
},
// Qweb
"qweb-t": {
"prefix": "qt",
"body": [
"<t$1>",
"\t$0",
"</t>"
]
},
"qweb-t-esc": {
"prefix": "qt-esc",
"body": "<t t-esc=\"$1\"/>"
},
"qweb-t-foreach": {
"prefix": "qt-foreach",
"body": [
"<t t-foreach=\"${1:docs}\" t-as=\"${2:doc}\">",
"\t$0",
"</t>"
]
},
}