summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-11-17 13:14:02 +0100
committerAaron Bohy <aab@odoo.com>2018-01-16 20:49:19 +0100
commit32b8cec5361174c92c45a4975d4e02f1fb448aa2 (patch)
tree110bd6986c2da1ed5047002b7ea40c91ea9fa5ed /addons/web/static/src/xml
parent9bee25a9df65f657fef0f2f32a7ad823fdc7d4e1 (diff)
[REF] web,*: ActionManager/ViewManager refactoring
This rev. is the first part (out of 3) of the refactoring of the ActionManager and ViewManager layer of the webclient. The main changes are: - there is no ViewManager anymore, its work is now handled by the ActionManager itself, but isolated in a specific file ; this eases a lot of things, as the breadcrumbs handling for example. - the ActionManager code is converted to the new coding principles and guidelines ; mainly, children widgets communicate with it by triggering events up, and not by function calls anymore. - the ActionManager layer is now testable, and a lot of tests have already been written. - the code in other addons has been adapted consequently. What's coming next: - introduce the 'AbstractAction' Widget, and make client actions and view controllers inherit from it ; this widget will implement a common API that could be used uniformly by the ActionManager (e.g. restore(), canBeLeft(), renderButtons(), getTitle()...). - move the ControlPanel handling from the ActionManager to the AbstractAction.
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/base.xml12
1 files changed, 5 insertions, 7 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 509c03fdf4b..ea4f554b183 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -177,8 +177,6 @@
</div>
</form>
-<div t-name="ActionManager" class="o_content"/>
-
<t t-name="ControlPanel">
<div class="o_control_panel">
<ol class="breadcrumb"/>
@@ -201,9 +199,9 @@
</div>
</t>
-<t t-name="ViewManager.switch-buttons">
+<t t-name="ControlPanel.SwitchButtons">
<t t-foreach="views" t-as="view">
- <button type="button" t-att-accesskey="view.accesskey"
+ <button type="button" t-att-accesskey="view.accessKey"
t-attf-class="btn btn-icon fa fa-lg #{view.icon} o_cp_switch_#{view.type}"
t-att-aria-label="view.type"
t-att-data-view-type="view.type" t-att-title="view.label"/>
@@ -259,14 +257,14 @@
<li class="divider"/>
<t t-if="view.type === 'form'">
<li><a href="#" data-action="set_defaults">Set Defaults</a></li>
- <t t-if="view.controller.getSelectedIds().length === 1">
+ <t t-if="controller.getSelectedIds().length === 1">
<li><a href="#" data-action="get_metadata">View Metadata</a></li>
</t>
</t>
<li><a href="#" data-action="fvg">Fields View Get</a></li>
<t t-if="can_edit">
<li>
- <a href="#" data-action="edit" data-model="ir.ui.view" t-att-data-id="view.fields_view.view_id">
+ <a href="#" data-action="edit" data-model="ir.ui.view" t-att-data-id="view.fieldsView.view_id">
<t t-if="view.type == 'form'">Edit Form view</t>
<t t-elif="view.type == 'list'">Edit List view</t>
<t t-elif="view.type == 'kanban'">Edit Kanban view</t>
@@ -277,7 +275,7 @@
<t t-else="1">Edit view, type: <t t-esc="_.str.capitalize(view.type)"/></t>
</a>
</li>
- <li t-if="searchview and searchview.$el.is(':visible')"><a href="#" data-action="edit" data-model="ir.ui.view" t-att-data-id="searchview.fields_view.view_id">Edit Search view</a></li>
+ <li t-if="searchview and searchview.$el.is(':visible')"><a href="#" data-action="edit" data-model="ir.ui.view" t-att-data-id="action.searchFieldsView.view_id">Edit SearchView</a></li>
</t>
</t>
</t>