diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/web/static/src/js/views/view_registry.js | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/web/static/src/js/views/view_registry.js')
| -rw-r--r-- | addons/web/static/src/js/views/view_registry.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/view_registry.js b/addons/web/static/src/js/views/view_registry.js new file mode 100644 index 00000000..f936787b --- /dev/null +++ b/addons/web/static/src/js/views/view_registry.js @@ -0,0 +1,44 @@ +odoo.define('web.view_registry', function (require) { +"use strict"; + +/** + * This module defines the view_registry. Web views are added to the registry + * in the 'web._view_registry' module to avoid cyclic dependencies. + * Views defined in other addons should be added in this registry as well, + * ideally in another module than the one defining the view, in order to + * separate the declarative part of a module (the view definition) from its + * 'side-effects' part. + */ + +var Registry = require('web.Registry'); + +return new Registry(); + +}); + +odoo.define('web._view_registry', function (require) { +"use strict"; + +/** + * The purpose of this module is to add the web views in the view_registry. + * This can't be done directly in the module defining the view_registry as it + * would produce cyclic dependencies. + */ + +var FormView = require('web.FormView'); +var GraphView = require('web.GraphView'); +var KanbanView = require('web.KanbanView'); +var ListView = require('web.ListView'); +var PivotView = require('web.PivotView'); +var CalendarView = require('web.CalendarView'); +var view_registry = require('web.view_registry'); + +view_registry + .add('form', FormView) + .add('list', ListView) + .add('kanban', KanbanView) + .add('graph', GraphView) + .add('pivot', PivotView) + .add('calendar', CalendarView); + +}); |
