Skip to content

Commit

Permalink
[FIX] project_timesheet_time_control: Avoid texts on buttons
Browse files Browse the repository at this point in the history
Since v14, `string` attribute of <button> elements are directly shown in
the views as text instead of being a tooltip, and thus, it takes a lot
of space in screen.

And it was not the intended visualization when the modules was
conceived, just a side effect.

Thus, we restore what we expect, moving `string` to `title` for having
the tooltips again.

TT40169
  • Loading branch information
pedrobaeza authored and CarlosRoca13 committed Nov 15, 2022
1 parent b06f3eb commit cdcf601
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,21 @@
<field name="show_time_control" invisible="1" />
<button
name="button_resume_work"
string="Resume work"
tabindex="-1"
type="object"
icon="fa-play-circle text-success"
attrs="{'invisible': [('show_time_control', '!=', 'resume')]}"
class="oe_stat_button"
title="Start work"
title="Resume work"
/>
<button
name="button_end_work"
string="Stop work"
tabindex="-1"
type="object"
icon="fa-stop-circle text-warning"
attrs="{'invisible': [('show_time_control', '!=', 'stop')]}"
class="oe_stat_button"
title="End work"
title="Stop work"
/>
</field>
</field>
Expand All @@ -48,22 +46,20 @@
<field name="show_time_control" invisible="1" />
<button
name="button_resume_work"
string="Resume work"
type="object"
icon="fa-play-circle text-success"
attrs="{'invisible': [('show_time_control', '!=', 'resume')]}"
class="oe_stat_button"
context="{'show_created_timer': True}"
title="Start work"
title="Resume work"
/>
<button
name="button_end_work"
string="Stop work"
type="object"
icon="fa-stop-circle text-warning"
attrs="{'invisible': [('show_time_control', '!=', 'stop')]}"
class="oe_stat_button"
title="End work"
title="Stop work"
/>
</div>
<field name="date" position="attributes">
Expand Down
14 changes: 5 additions & 9 deletions project_timesheet_time_control/views/project_task_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<field name="show_time_control" invisible="1" />
<button
name="button_resume_work"
string="Resume work"
title="Resume work"
tabindex="-1"
type="object"
icon="fa-play-circle text-success"
Expand All @@ -57,7 +57,7 @@
/>
<button
name="button_end_work"
string="Stop work"
title="Stop work"
tabindex="-1"
type="object"
icon="fa-stop-circle text-warning"
Expand Down Expand Up @@ -123,24 +123,22 @@
<field name="show_time_control" invisible="1" />
<button
name="button_resume_work"
string="Resume work"
tabindex="-1"
type="object"
icon="fa-play-circle text-success"
attrs="{'invisible': [('show_time_control', '!=', 'resume')]}"
class="oe_stat_button"
context="{'show_created_timer': True}"
title="Start work"
title="Resume work"
/>
<button
name="button_end_work"
string="Stop work"
tabindex="-1"
type="object"
icon="fa-stop-circle text-warning"
attrs="{'invisible': [('show_time_control', '!=', 'stop')]}"
class="oe_stat_button"
title="End work"
title="Stop work"
/>
</div>
</xpath>
Expand All @@ -161,7 +159,6 @@
name="button_start_work"
attrs="{'invisible': [('show_time_control', '!=', 'start')]}"
class="o_kanban_inline_block fa fa-lg fa-play-circle text-success"
string="Start work"
tabindex="-1"
type="object"
title="Start work"
Expand All @@ -170,10 +167,9 @@
name="button_end_work"
attrs="{'invisible': [('show_time_control', '!=', 'stop')]}"
class="o_kanban_inline_block fa fa-lg fa-stop-circle text-warning"
string="Stop work"
tabindex="-1"
type="object"
title="End work"
title="Stop work"
/>
</xpath>
</field>
Expand Down

0 comments on commit cdcf601

Please sign in to comment.