[FIX] web{,_kanban}: too much and too little shortcuts

When several accesskey with the same key,  are defined on elements, the
last one (even if not displayed) is the one which will be actioned and
the key sequence is pressed.

This caused an issue since the "Pager" template is shared between all
elements, even the x2many relational widgets.

Also there was shortcut for Create/Save/Discard on the form view, but
those shortcuts should also be enabled in the list and kanban view.

closes #9267
opw-652888
This commit is contained in:
Nicolas Lempereur
2015-10-28 15:32:31 +01:00
parent 9593c08673
commit 665bc1c935
2 changed files with 11 additions and 6 deletions
+10 -5
View File
@@ -216,8 +216,13 @@
<t t-raw="0"/>
</div>
<div class="btn-group btn-group-sm oe-pager-buttons" style="display: inline-block">
<a class="fa fa-chevron-left btn btn-default oe-pager-button" accesskey="O" type="button" data-pager-action="previous"></a>
<a class="fa fa-chevron-right btn btn-default oe-pager-button" accesskey="P" type="button" data-pager-action="next"></a>
<!-- accesskeys not wanted in X2Many widgets -->
<t t-if="!widget.x2m">
<t t-set="att_prev" t-value="{'accesskey': 'O'}" />
<t t-set="att_next" t-value="{'accesskey': 'P'}" />
</t>
<a class="fa fa-chevron-left btn btn-default oe-pager-button" t-att="att_prev" type="button" data-pager-action="previous"></a>
<a class="fa fa-chevron-right btn btn-default oe-pager-button" t-att="att_next" type="button" data-pager-action="next"></a>
</div>
</span>
@@ -361,7 +366,7 @@
<t t-name="ListView.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="btn btn-sm btn-primary o_list_button_add">
<button type="button" class="btn btn-sm btn-primary o_list_button_add" accesskey="C">
<t t-esc="widget.options.addable"/>
</button>
</div>
@@ -402,10 +407,10 @@
</tr>
<t t-extend="ListView.buttons">
<t t-jquery="button.o_list_button_add" t-operation="after">
<button type="button" class="btn btn-primary btn-sm o_list_button_save">
<button type="button" class="btn btn-primary btn-sm o_list_button_save" accesskey="S">
Save
</button>
<button type="button" class="btn btn-default btn-sm o_list_button_discard">
<button type="button" class="btn btn-default btn-sm o_list_button_discard" accesskey="D">
Discard
</button>
</t>
@@ -3,7 +3,7 @@
<t t-name="KanbanView.buttons">
<t t-if="display">
<div>
<button type="button" class="btn btn-primary btn-sm o-kanban-button-new">
<button type="button" class="btn btn-primary btn-sm o-kanban-button-new" accesskey="C">
<t t-esc="widget.options.create_text || _t('Create')"/>
</button>
</div>