summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-03-05 10:31:19 +0100
committerAaron Bohy <aab@odoo.com>2015-03-20 16:34:41 +0100
commit546c07a58f4f715019b48a48259a580d7d564b56 (patch)
tree7548084d9fb28d87998ec7eea7baa4ab8dde80c1 /addons/web/static/src/xml
parent20b4aaab83ea6f35347773754d644806a2f65b5d (diff)
[IMP] Web: Use of a ControlPanel in One2Many Fields
Creation of the One2ManyControlPanel template. The One2ManyControlPanel can only contain action_buttons and a pager. Typically, in One2Many Kanban, buttons are displayed (in edit mode) and in One2Many Lists, the pager is displayed. Improvement of all Views.buttons templates so that if there is no button to render, it does not render an empty div. This was necessary for Kanban buttons to prevent padding when there is no button displayed. Changes in the other views were motivated by uniformity concerns. This prevents to add empty div in the DOM as well. Exception for FormView where the outer div is required for the option footer_to_buttons to work. This fixes a bug as the pager is now available in One2Many Lists, which was not the case before, even if there were more than 80 items in the list, i.e. some items were unreachable. cp_bus argument in ViewManager init() is now required. If there is no ControlPanel to communicate with, a dummy Bus should be given ot the ViewManager.
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/base.xml13
1 files changed, 10 insertions, 3 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index a630510f058..d74fb02d9ff 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -495,6 +495,13 @@
</div>
</t>
+<t t-name="One2ManyControlPanel">
+ <div class="oe-o2m-control-panel container-fluid">
+ <div class="oe-cp-buttons pull-left"/>
+ <div class="oe-cp-pager pull-right"/>
+ </div>
+</t>
+
<div t-name="ViewManager" class="oe-view-manager">
<div class="oe-view-manager-content">
<t t-foreach="widget.views" t-as="view">
@@ -716,13 +723,13 @@
</tfoot>
</table>
<t t-name="ListView.buttons">
- <div class="oe_list_buttons">
<t t-if="!widget.no_leaf and widget.options.action_buttons !== false and widget.options.addable and widget.is_action_enabled('create')">
+ <div class="oe_list_buttons">
<button type="button" class="oe_list_add btn btn-primary btn-sm">
<t t-esc="widget.options.addable"/>
</button>
- </t>
</div>
+ </t>
</t>
<t t-name="ListView.pager" t-if="!widget.no_leaf and widget.options.pager !== false" t-call="ViewPager">
<span class="oe_list_pager_state"></span>
@@ -793,7 +800,7 @@
<div class="oe_form_container"/>
</div>
</t>
-<div t-name="FormView.buttons">
+<div t-name="FormView.buttons" class="oe_form_buttons">
<t t-if="widget.options.action_buttons !== false">
<div class="oe_form_buttons_view">
<button t-if="widget.is_action_enabled('edit')"