How can I disable the 'send mail' action in the contact view of Odoo please? I m a beginner in odoo
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
Hi,
You can delete the action from Window actions.Go to Settings -> Technical -> Window Actions.
Search for Send Email and choose the action with context {'default_composition_mode': 'mass_mail', 'default_partner_to': "{{ object.id or '' }}", 'default_subtype_xmlid': 'mail.mt_comment', 'default_reply_to_force_new': True}.
After you delete that, you won't see the option to send email from contact.

Hope it helps
We can't delete that send email action like removing a server action?
You can disable the ‘send mail’ action in the contact view of Odoo by inheriting the mail.thread model and overriding the message_post method. This method is responsible for sending the email when the ‘send mail’ action is triggered. You can modify the method to prevent the email from being sent, or to add some conditions or validations before sending the email.
Here is an example of how to override the message_post method in a custom module:
from odoo import models, api
class MailThread(models.AbstractModel):
_inherit = 'mail.thread'
@api.returns('mail.message', lambda value: value.id)
def message_post(self, **kwargs):
# You can add your own logic here to disable or control the email sending
# For example, you can check the user's role or the message's content
# Or you can simply return without calling the super method
return super(MailThread, self).message_post(**kwargs)
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar| Post Terkait | Replies | Tampilan | Aktivitas | |
|---|---|---|---|---|
|
|
1
Okt 23
|
9712 | ||
|
|
2
Okt 23
|
6778 | ||
|
|
3
Sep 23
|
3576 | ||
|
|
0
Mei 23
|
3577 | ||
|
|
1
Mei 23
|
2669 |