Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3762 Weergaven

Is there a way to hide/remove the Send Message button in the Chatter box but still keep the Log Note and Activities in v16?

Avatar
Annuleer
Auteur

Thank you, Bella. Where should this code be added?

You can create a src folder in your custom addon ,add a xml folder add this code into it

Enhance your Odoo mail chatter experience by dynamically controlling the visibility of key buttons based on user preferences.
With this app, administrators can configure visibility settings for the most commonly used buttons in the chatter interface, such as "Send Message", "Log Note", "Activities", and more. Tailor the interface to individual users or specific models, ensuring a streamlined, role-based user experience.
https://apps.odoo.com/apps/modules/16.0/mh_hide_chatter_view_buttons

Beste antwoord

Hi 

Try with Following code 

<templates xml:space="preserve">
     <t t-name="ChatterTopbar" t-inherit="mail.ChatterTopbar" t-inherit-mode="extension" owl="1">
        <xpath expr="//div[hasclass('o_ChatterTopbar_controllers')]" position="replace">
        <div class="o_ChatterTopbar_controllers d-flex pe-2" t-if="chatterTopbar.chatter.threadView">
 
          <button class="o_ChatterTopbar_button o_ChatterTopbar_buttonSendMessage btn text-nowrap me-2"
                    type="button" style="display:none;"
                    t-att-class="{
                    'o-active btn-odoo': chatterTopbar.chatter.composerView and !chatterTopbar.chatter.composerView.composer.isLog,
 
                  'btn-odoo': !chatterTopbar.chatter.composerView,
 
                  'btn-light': chatterTopbar.chatter.composerView and chatterTopbar.chatter.composerView.composer.isLog,}"
 
                  t-att-disabled="!chatterTopbar.chatter.canPostMessage" data-hotkey="m"
 
                  t-on-click="chatterTopbar.chatter.onClickSendMessage">
 
              Send message
</button>
            <button class="o_ChatterTopbar_button o_ChatterTopbar_buttonLogNote btn text-nowrap"
                    type="button"
                    t-att-class="{
                                'o-active btn-odoo': chatterTopbar.chatter.composerView and chatterTopbar.chatter.composerView.composer.isLog,
 
                              'btn-light': chatterTopbar.chatter.composerView and !chatterTopbar.chatter.composerView.composer.isLog or !chatterTopbar.chatter.composerView,
 
                          }"
                    t-att-disabled="!chatterTopbar.chatter.isTemporary and !chatterTopbar.chatter.hasWriteAccess"
 
                  t-on-click="chatterTopbar.chatter.onClickLogNote" data-hotkey="shift+m">
 
                          Log note
</button>
            </div>
        </xpath>
    </t>
</templates>


Regards

Avatar
Annuleer

Hi Bella,

thanks for posting this. I tried creating a custom module, but using the code you provided in a static MXL file
and set up my manifest file like this

{
'name': 'Hide Send Message',
'version': '16.1.0',
'summary': 'Hide the Send Message Button in Sidebar Chatter',
'description': 'if you do not want to take a chance on your users sending messages to the wrong person, just hide the send message button all together',
'category': 'Tehcnical',
'author': 'me',
'website': 'https://www.me.com',
'depends': ['base'],
'sequence': -100,
'data': [
'static/xml/hide_chatter_send_message.xml',
],
'installable': True,
'application': True,
'auto_install': False,
}

when i go to activate it, i get the following final error

AssertionError: Document does not comply with schema

any ideas what i am doing wrong, sorry, i am new to working with custom app/modules.

you can add it in the manifest inside the assets