[FIX] web: fix an issue where an empty button box is displayed as 'null'

If the button box exists but contains nothing (or nothing visible), it
will be displayed as the string 'null' in the control panel

This commit changes this behaviour to show nothing and remove the
culprit view (an invisible button should simply not be there)

X-original-commit: 0089b302bf30efb324c80f74f058d6d64f686e4c
Part-of: odoo/odoo#122111
This commit is contained in:
Damien Bouvy
2023-05-23 22:32:46 +02:00
parent 5a51d7246d
commit 3bbfad3a47
2 changed files with 1 additions and 17 deletions
@@ -73,22 +73,6 @@
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button
class="oe_stat_button"
icon="fa-calendar"
type="action"
invisible="1"
name="%(hr_leave_action_holiday_allocation_id)d"
help="Time off Taken/Total Allocated">
<div class="o_stat_info">
<span class="o_stat_value">
<field name="leaves_taken" digits="[42,1]"/>/<field name="max_leaves" digits="[42,1]"/>
</span>
<span class="o_stat_text">
Time Off
</span>
</div>
</button>
</div>
<div id="title" class="oe_title">
<h2><field name="name" class="w-100" placeholder="e.g. Time Off type (From validity start to validity end / no limit)" attrs="{'invisible': [('state', 'not in', ('draft', 'confirm'))]}" required="1"/>
@@ -166,7 +166,7 @@ export class FormCompiler extends ViewCompiler {
append(buttonBox, mainSlot);
}
return hasContent ? buttonBox : null;
return hasContent ? buttonBox : '';
}
compileButton(el, params) {