Skip to content

Commit

Permalink
Add new snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
mstuttgart committed Oct 1, 2023
1 parent 92a7740 commit fd4dd1f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,16 @@ Below is a list of all available snippets.
| `omenur` | Create New Menu Item in the Upper bar |
| `omenuc` | Create New Menu Item for Categories |
| `omenua` | Create New Menu Item for Actions |
| `ocron` | Add a ir.cron record (11.0 version) |
| `ocron` | Add a ir.cron record |
| `obtn` | Add Odoo button |
| `obtnbox` | Add Button Box on View |
| `ogroup` | Add group tag on View |
| `ofield` | Add Field on View |
| `odata` | Add data tag on View |
| `ochatter` | Add chatter tag on View |
| `oaurl` | Create action.url tag |
| `oaserver` | Create action.server tag |
| `oaclient` | Create action.client tag |

<!-- <summary>QWeb snippets</summary> -->

Expand All @@ -159,7 +162,7 @@ Below is a list of all available snippets.
| `otforeach` | Add t-foreach tag on View |
| `otif` | Add t-if tag on View |
| `otelif` | Add t-elif tag on View |
| `otifelse` | Add t-if-else tag on View |
| `otifelse` | Add t-if-else tag on View |
| `otraw` | Add t-raw tag on View |
| `otesc` | Add t-esc tag on View |
| `otset` | Add t-set tag on View |
Expand Down
39 changes: 39 additions & 0 deletions snippets/xml.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@
"\t<field name=\"model_id\" ref=\"model_${2:model_name}\"/>",
"\t<field name=\"state\">code</field>",
"\t<field name=\"code\">model.${10:method_name}()</field>",
"\t<field name=\"priority\" eval=\"5\" />",
"</record>"
],
"description": "Add a ir.cron record"
Expand Down Expand Up @@ -586,5 +587,43 @@
"</div>"
],
"description": "Create Odoo 'oechater' tag"
},
"odoo_ir_action_act_url": {
"prefix": "oaurl",
"body": [
"\t<record id=\"action_${1:action_id}\" model=\"ir.actions.act_url\">",
"\t<field name=\"name\">${2:name}</field>",
"\t<field name=\"url\">/${3:url}</field>",
"\t<field name=\"target\">self</field>",
"</record>"
],
"description": "Create action.url tag"
},
"odoo_ir_action_act_server": {
"prefix": "oaserver",
"body": [
"<!-- ${1:model.name} action server -->",
"<record id=\"action_${2:model_name}\" model=\"ir.actions.server\">",
"\t<field name=\"name\">${1}.action.server</field>",
"\t<field name=\"model_id\" ref=\"model_${1:model.name}\"/>",
"\t<field name=\"state\">code</field>",
"\t<field name=\"code\">",
"\t\trecord.${10:method_name}()",
"\t</field>",
"</record>"
],
"description": "Create action.server tag"
},
"odoo_ir_action_act_client": {
"prefix": "oaclient",
"body": [
"<!-- ${1:model.name} action client -->",
"<record id=\"action_${2:model_name}\" model=\"ir.actions.client\">",
"\t<field name=\"name\">${2}.action.client</field>",
"\t<field name=\"tag\" ref=\"${3:tag_name}\"/>",
"\t<field name=\"context\" eval=\"{}\"/>",
"</record>"
],
"description": "Create action.client tag"
}
}

0 comments on commit fd4dd1f

Please sign in to comment.