Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
159 Vistas



I want to change send message button text. this chatter is available on right section of helpdesk ticket. I appreciate if someone help me out in this 

Avatar
Descartar
Mejor respuesta

Hi,


Try with the following code.


<templates>

   <t t-name="important.Chatter" t-inherit="mail.Chatter"

      t-inherit-mode="extension">

       <xpath expr="//*[contains(@class, 'o-mail-Chatter-sendMessage')]"

              position="replace">

            <button class="o-mail-Chatter-sendMessage btn text-nowrap me-1" t-att-class="{

                'btn-primary': state.composerType !== 'note',

                'btn-secondary': state.composerType === 'note',

                'active': state.composerType === 'message',

                'my-2': !props.compactHeight

            }" t-att-disabled="!state.thread.hasWriteAccess and !(state.thread.hasReadAccess and state.thread.canPostOnReadonly) and props.threadId" data-hotkey="m" t-on-click="() => this.toggleComposer('message')">

                Your Button Name

            </button>

      </xpath>

  </t>

</templates>



Reference:


-https://www.cybrosys.com/blog/how-to-add-a-custom-button-to-the-chatter-in-odoo-18


Hope it helps

Avatar
Descartar
Autor

Thanks for your timely support. I appreciate , if you guide me to change the Log note button text also.

Autor

Getting this error if apply this on Log Note button.

OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)
Error: An error occured in the owl lifecycle (see this Error's "cause" property)
at handleError (https://hui-opco-staging-22166402.dev.odoo.com/web/assets/f8a0653/web.assets_web.min.js:972:101)
at App.handleError (https://hui-opco-staging-22166402.dev.odoo.com/web/assets/f8a0653/web.assets_web.min.js:1619:29)
at Fiber._render (https://hui-opco-staging-22166402.dev.odoo.com/web/assets/f8a0653/web.assets_web.min.js:997:19)
at Fiber.render (https://hui-opco-staging-22166402.dev.odoo.com/web/assets/f8a0653/web.assets_web.min.js:995:6)
at ComponentNode.initiateRender (https://hui-opco-staging-22166402.dev.odoo.com/web/assets/f8a0653/web.assets_web.min.js:1065:47)

Caused by: Error: Element '<xpath expr="//*[contains(@class, 'o-mail-Chatter-logNote') and @data-hotkey='n']" position="replace">
<button class="o-mail-Chatter-logNote btn text-nowrap me-1" t-att-class="{ 'btn-secondary': state.composerType !== 'message', 'btn-primary': state.composerType === 'note', 'active': state.composerType === 'note', 'my-2': !props.compactHeight }" t-att-disabled="!state.thread.hasWriteAccess and props.threadId" data-hotkey="n" t-on-click="() =&gt; this.toggleComposer('note')">
Internal Note
</button>
</xpath>' cannot be located in element tree
Error: Element '<xpath expr="//*[contains(@class, 'o-mail-Chatter-logNote') and @data-hotkey='n']" position="replace">
<button class="o-mail-Chatter-logNote btn text-nowrap me-1" t-att-class="{ 'btn-secondary': state.composerType !== 'message', 'btn-primary': state.composerType === 'note', 'active': state.composerType === 'note', 'my-2': !props.compactHeight }" t-att-disabled="!state.thread.hasWriteAccess and props.threadId" data-hotkey="n" t-on-click="() =&gt; this.toggleComposer('note')">
Internal Note
</button>
</xpath>' cannot be located in element tree

Mejor respuesta

Hii,

Create or update your custom module.

Add an XML file like this:

<!-- my_module/views/chatter_button_override.xml --> <odoo> <template id = "custom_chatter_send_message_button" inherit_id = "mail.chatter"> <xpath expr = "//button[@class='o_chatter_button_send']" position = "attributes"> <attribute name = "title" >Send Update </attribute> </xpath> <xpath expr = "//button[@class='o_chatter_button_send']/span" position = "replace"> <span>Send Update </span> </xpath> </template> </odoo>

This will replace the text "Send message" with "Send Update"

i hope it is usefull

Avatar
Descartar
Autor

Hi , Thanks for your time but this code is giving error, template name not found. I would recommend Cybrosys Answer. That one is working.

Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 25
76
0
nov 23
1033
0
mar 25
1224
2
abr 25
961
0
oct 24
1263