Se rendre au contenu
Menu
Cette question a été signalée

 I’m extending web.HtmlField in Odoo 17 using OWL to add a mic button for voice recording. The button shows in char, text, and search fields but not in HtmlField. Here’s my code:

xml

Copy

<t t-name="web.HtmlField" t-inherit="web.HtmlField" t-inherit-mode="extension" owl="1">
    <xpath expr="." position="inside">
        <div t-if="state.isVoiceEnabled">
            <button class="o_Composer_button o_Composer_toolButton btn btn-light fa fa-microphone border-0 rounded-pill mx-1"
                    id="record_voice"
                    title="Voice"
                    aria-label="Voice"
                    type="button"
                    t-on-click="toggleRecording">
            </button>
        </div>
    </xpath>
</t>

Run HTML

What I’ve Tried

  • Added owl="1" and t-inherit-mode="extension".
  • Used t-if to conditionally render the button.

Issue

  • Expected: Mic icon appears in HtmlField when state.isVoiceEnabled is true.
  • Actual: Mic icon shows in char, text, and search fields but not in HtmlField.

Questions

  1. Why is the mic icon not showing in HtmlField?
  2. How can I properly extend web.HtmlField to display the button?
Avatar
Ignorer
Publications associées Réponses Vues Activité
2
avr. 25
2132
1
janv. 25
1725
1
août 24
3658
0
mars 25
1170
1
août 24
3175