Skip to content

Add new snippets #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}