Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged

 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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
dub 25
2153
1
led 25
1744
1
srp 24
3669
0
bře 25
1182
1
srp 24
3188