I want to hide Send messages and Activities button from chatter and keep other functionalities as it is.
Can any one guide me through this ??
If any one have developed help me!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilidad
- Inventario
- PoS
- Proyecto
- MRP
Se marcó esta pregunta
2
Respuestas
871
Vistas
Hi,
You don’t need to modify the Odoo source code or remove the buttons globally.
The correct way is to extend the Chatter template and hide the “Send Message” and “Activities” buttons only for a specific model using props.threadModel.
Create a new XML file in your custom module:
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!-- Inherit Odoo Chatter -->
<t t-inherit="mail.Chatter" t-inherit-mode="extension">
<!-- Hide Send Message button for specific model -->
<xpath expr="//button[contains(@class, 'o-mail-Chatter-sendMessage')]" position="attributes">
<attribute name="t-if">props.hasMessageList and props.threadModel !== 'your.model'</attribute>
</xpath>
<!-- Hide Activities button for specific model -->
<xpath expr="//button[contains(@class, 'o-mail-Chatter-activity')]" position="attributes">
<attribute name="t-if">props.hasActivities and props.threadModel !== 'your.model'</attribute>
</xpath>
</t>
</templates>
Replace "your.model" with the model where you want the buttons to be hidden.
Hope it helps
Hello,
In this question: Odoo Forum Link, I renamed the "Send Message" button. However, in your case, you can comment out the first button
Thank you for responding.
If I will comment out the first button it will removed from all modules. I want to remove send message and activities for specific model, by overriding, not by changing the source code.
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
Inscribirse