[IMP] web: remove useless tooltips in standard views

Tooltips (and aria-label) should be used when the content of the element
is not self explanatory; but in the case of the create/save/edit buttons
available in several view control panels (kanban,list,form), tooltips
with dubious usefulness were added (e.g. "Create record" when you hover
on a button labeled "CREATE" is not really an information bomb).

Since these buttons tend to be used in tours, and the "coucouilles"
of the tours will also be some sort of tooltips, it means that you
can have frequent weird visual interactions between nunuts and stupid
tooltips.

This commit removes these stupid tooltips.

Feedback-2973374

closes odoo/odoo#100078

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
This commit is contained in:
Damien Bouvy
2022-09-13 22:16:13 +02:00
parent dd72a40926
commit 54438fdebf
4 changed files with 8 additions and 27 deletions
@@ -34,18 +34,18 @@
<t t-name="web.FormView.Buttons" owl="1">
<div class="o_cp_buttons" role="toolbar" aria-label="Main actions" t-ref="cpButtons">
<div t-if="model.root.isInEdition" class="o_form_buttons_edit">
<button type="button" class="btn btn-primary o_form_button_save" data-tooltip="Save record" data-hotkey="s" t-on-click.stop="() => this.save()">
<button type="button" class="btn btn-primary o_form_button_save" data-hotkey="s" t-on-click.stop="() => this.save()">
Save
</button>
<button type="button" class="btn btn-secondary o_form_button_cancel" data-tooltip="Discard changes" data-hotkey="j" t-on-click.stop="discard">
<button type="button" class="btn btn-secondary o_form_button_cancel" data-hotkey="j" t-on-click.stop="discard">
Discard
</button>
</div>
<div t-else="canEdit or canCreate" class="o_form_buttons_view">
<button t-if="canEdit" type="button" class="btn btn-primary o_form_button_edit" data-tooltip="Edit record" data-hotkey="a" data-bounce-button="" t-on-click.stop="edit">
<button t-if="canEdit" type="button" class="btn btn-primary o_form_button_edit" data-hotkey="a" data-bounce-button="" t-on-click.stop="edit">
Edit
</button>
<button t-if="canCreate" type="button" class="btn btn-secondary o_form_button_create" data-tooltip="Create record" data-hotkey="c" t-on-click.stop="create">
<button t-if="canCreate" type="button" class="btn btn-secondary o_form_button_create" data-hotkey="c" t-on-click.stop="create">
Create
</button>
</div>
@@ -22,7 +22,7 @@
<t t-name="web.KanbanView.Buttons" owl="1">
<div t-if="props.showButtons" class="o_cp_buttons d-flex align-items-baseline" role="toolbar" aria-label="Main actions">
<t t-if="canCreate">
<button type="button" class="btn btn-primary o-kanban-button-new" data-tooltip="Create record" aria-label="Create record" accesskey="c" t-on-click="() => this.createRecord(null)" data-bounce-button="">
<button type="button" class="btn btn-primary o-kanban-button-new" accesskey="c" t-on-click="() => this.createRecord(null)" data-bounce-button="">
Create
</button>
</t>
@@ -35,15 +35,15 @@
<div class="o_list_buttons d-flex" role="toolbar" aria-label="Main actions">
<t t-if="props.showButtons">
<t t-if="model.root.editedRecord">
<button type="button" class="btn btn-primary o_list_button_save" data-tooltip="Save record" aria-label="Save record" data-hotkey="s" t-on-click.stop="onClickSave">
<button type="button" class="btn btn-primary o_list_button_save" data-hotkey="s" t-on-click.stop="onClickSave">
Save
</button>
<button type="button" class="btn btn-secondary o_list_button_discard" data-tooltip="Discard changes" aria-label="Discard changes" data-hotkey="j" t-on-click="onClickDiscard" t-on-mousedown="onMouseDownDiscard">
<button type="button" class="btn btn-secondary o_list_button_discard" data-hotkey="j" t-on-click="onClickDiscard" t-on-mousedown="onMouseDownDiscard">
Discard
</button>
</t>
<t t-elif="activeActions['create'] and (!model.root.isGrouped or !editable)">
<button type="button" class="btn btn-primary o_list_button_add" data-tooltip="Create record" aria-label="Create record" data-hotkey="c" t-on-click="onClickCreate" data-bounce-button="">
<button type="button" class="btn btn-primary o_list_button_add" data-hotkey="c" t-on-click="onClickCreate" data-bounce-button="">
Create
</button>
</t>
@@ -10844,25 +10844,6 @@ QUnit.module("Views", (hooks) => {
}
);
QUnit.test("display tooltips for save and discard buttons", async function (assert) {
await makeView({
type: "form",
resModel: "partner",
serverData,
arch: `<form><field name="foo"/></form>`,
});
assert.hasAttrValue(
target.querySelector(".o_form_button_save"),
"data-tooltip",
"Save record"
);
assert.hasAttrValue(
target.querySelector(".o_form_button_cancel"),
"data-tooltip",
"Discard changes"
);
});
QUnit.test("resequence list lines when discardable lines are present", async function (assert) {
var onchangeNum = 0;
serverData.models.partner.onchanges = {