跳至内容
菜单
此问题已终结
5 回复
1662 查看

Hello,

i try to access to the chatter on the right to change the label of the button "Send message"

Before v16, i can just change the translation but in v16 it is not possible anymore.

Is anybody know how to do that in v16

I tried to override the chatter but it doesn't works for now!?!

形象
丢弃
最佳答案

i think its a QWeb Template which is different from .xml files

see this file:

addons/mail/static/src/components/chatter_topbar/chatter_topbar.xml

check the path, it resides in static folder.

note: 3 more are there in addons path, don't know which one and how to inherit and modify.



形象
丢弃
最佳答案

Hi,

Inherit 'ChatterTopbar' templates and add a label for the button send message  with the desired one

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
        <t t-inherit="mail.ChatterTopbar" t-inherit-mode="extension">
<xpath expr="//button[hasclass('o_ChatterTopbar_buttonSendMessage')]" position="attributes">
         <attribute name="labelaria-label" >custom name</attribute>
          </xpath>
          </t>
</templates>

Also, Add your xml file in manifest as below,

'assets': {
'web.assets_qweb': [
'your_custom_module/static/src/chatter_topbar.xml',
],
},


Replace custom name with the desired name.


Hope it helps,


形象
丢弃
最佳答案

This is a work-around. Try inherit the view, replace the button with your new button using all the same attribute except the label 

形象
丢弃
最佳答案

Any luck anyone?

形象
丢弃
编写者 最佳答案

Hello SmithJohn45

Thank you for your answer

I already found those static files but don't talk about them to have more ideas

And like you i don't know how to override those files. I tried with t-extend and other but nothing works for now

形象
丢弃