Skip to content

Commit 8fd2e44

Browse files
committed
Improve action window snippet with regex
1 parent 3699cd7 commit 8fd2e44

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

snippets/xml.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,17 +317,21 @@
317317
"prefix": "oact",
318318
"body": [
319319
"<!-- ${1:model.name} action window -->",
320-
"<record id=\"${2:model_name}_action\" model=\"ir.actions.act_window\">",
320+
"<record id=\"${2:${1/[.]/_/g}}_action\" model=\"ir.actions.act_window\">",
321321
"\t<field name=\"name\">${1:model.name}.action</field>",
322322
"\t<field name=\"type\">ir.actions.act_window</field>",
323323
"\t<field name=\"res_model\">${1:model.name}</field>",
324-
"\t<field name=\"view_mode\">tree,form</field>",
324+
"\t<field name=\"view_mode\">${3:tree,form}</field>",
325325
"\t<field name=\"view_type\">form</field>",
326+
"\t<field name=\"___domain\">[${5}]</field>",
327+
"\t<field name=\"context\">{${6}}</field>",
328+
"\t<field name=\"target\">{${7:|current,new,fullscreen,main,inline|}}</field>",
326329
"\t<field name=\"help\" type=\"html\">",
327330
"\t\t<p class=\"oe_view_nocontent_create\">",
328331
"\t\t\t<!-- Add Text Here -->",
329332
"\t\t</p><p>",
330333
"\t\t\t<!-- More details about what a user can do with this object will be OK --> ",
334+
"\t\t${0}",
331335
"\t\t</p>",
332336
"\t</field>",
333337
"</record>"

0 commit comments

Comments
 (0)