Skip to content

Commit 6e2ef06

Browse files
committed
[NEW] Add calendar and calendar inherit views snippets
1 parent 9fcbad4 commit 6e2ef06

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ Below is a list of all available snippets.
7474
| `opivoti` | Inherit Existing Pivot View |
7575
| `okanban` | Create Kanban View |
7676
| `okanbani` | Inherit Existing Kanban View |
77+
| `ocalendar` | Create Calendar View |
78+
| `ocalendari` | Inherit Existing Calendar View |
7779
| `oxpath` | Add the structure of xpath |
7880
| `oxpathattr` | Add the structure of xpath to attributes |
7981
| `oact` | Create new Action |

snippets/xml.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,39 @@
201201
],
202202
"description": "Inherit Existing Kanban View"
203203
},
204+
"odoo_calendar": {
205+
"prefix": "ocalendar",
206+
"body": [
207+
"<!-- ${1:model.name} calendar view -->",
208+
"<record id=\"${2:model_name}_view_calendar\" model=\"ir.ui.view\">",
209+
"\t<field name=\"name\">${1:first.name}.view.calendar</field>",
210+
"\t<field name=\"model\">${1:first.name}</field>",
211+
"\t<field name=\"arch\" type=\"xml\">",
212+
"\t\t<calendar string=\"${3:Calendar Description}\" date_start=\"{4}\" mode=\"{6:month}\">",
213+
"\t\t\t<!-- Add your fields here -->",
214+
"\t\t\t$0",
215+
"\t\t</calendar>",
216+
"\t</field>",
217+
"</record>"
218+
],
219+
"description": "Create Calendar View"
220+
},
221+
"odoo_calendar_inherit": {
222+
"prefix": "ocalendari",
223+
"body": [
224+
"<!-- ${1:model.name} inherit calendar view -->",
225+
"<record id=\"${2:view_id}\" model=\"ir.ui.view\">",
226+
"\t<field name=\"name\">${1:model.name}.inherit.view.calendar</field>",
227+
"\t<field name=\"model\">${1:model.name}</field>",
228+
"\t<field name=\"inherit_id\" ref=\"${3:base_module}.${2:view_id}\"/>",
229+
"\t<field name=\"arch\" type=\"xml\">",
230+
"\t\t<!-- Add you xpath here -->",
231+
"\t\t$0",
232+
"\t</field>",
233+
"</record>"
234+
],
235+
"description": "Inherit Existing Calendar View"
236+
},
204237
"odoo_xpath": {
205238
"prefix": "oxpath",
206239
"body": [

0 commit comments

Comments
 (0)