Skip to content

Commit cead677

Browse files
committed
[NEW] Add pivot and pivot inherit views snippets
1 parent 3324158 commit cead677

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ Below is a list of all available snippets.
7070
| `osearchi` | Inherit Existing Search View |
7171
| `ograph` | Create Graph View |
7272
| `ographi` | Inherit Existing Graph View |
73+
| `opivot` | Create Pivot View |
74+
| `opivoti` | Inherit Existing Pivot View |
7375
| `oxpath` | Add the structure of xpath |
7476
| `oxpathattr` | Add the structure of xpath to attributes |
7577
| `oact` | Create new Action |

snippets/xml.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,40 @@
133133
"\t</field>",
134134
"</record>"
135135
],
136-
"description": "Inherit Existing graph View"
136+
"description": "Inherit Existing Graph View"
137+
},
138+
"odoo_pivot": {
139+
"prefix": "opivot",
140+
"body": [
141+
"<!-- ${1:model.name} pivot view -->",
142+
"<record id=\"${2:model_name}_view_pivot\" model=\"ir.ui.view\">",
143+
"\t<field name=\"name\">${1:first.name}.view.pivot</field>",
144+
"\t<field name=\"model\">${1:first.name}</field>",
145+
"\t<field name=\"arch\" type=\"xml\">",
146+
"\t\t<pivot string=\"${3:Pivot Description}\">",
147+
"\t\t\t<!-- Add your fields here -->",
148+
"\t\t\t$0",
149+
"\t\t</pivot>",
150+
"\t</field>",
151+
"</record>"
152+
],
153+
"description": "Create Pivot View"
154+
},
155+
"odoo_pivot_inherit": {
156+
"prefix": "opivoti",
157+
"body": [
158+
"<!-- ${1:model.name} inherit pivot view -->",
159+
"<record id=\"${2:view_id}\" model=\"ir.ui.view\">",
160+
"\t<field name=\"name\">${1:model.name}.inherit.view.pivot</field>",
161+
"\t<field name=\"model\">${1:model.name}</field>",
162+
"\t<field name=\"inherit_id\" ref=\"${3:base_module}.${2:view_id}\"/>",
163+
"\t<field name=\"arch\" type=\"xml\">",
164+
"\t\t<!-- Add you xpath here -->",
165+
"\t\t$0",
166+
"\t</field>",
167+
"</record>"
168+
],
169+
"description": "Inherit Existing Pivot View"
137170
},
138171
"odoo_xpath": {
139172
"prefix": "oxpath",

0 commit comments

Comments
 (0)