I wrote custom module to send an email to a sales team when new lead is created like this:
from odoo import models, fields, api
class Lead(models.Model):
_inherit = 'crm.lead'
@api.model
def create(self, vals):
record = super().create(vals)
template_id = self.env.ref('custom_interface.new_signal').id
if template_id:
record.message_post_with_template(template_id)
return record
And by doing this users from particular sales team get the email with automaticly attached buttons to manage and display the lead.
But I have two companies and two website on different domains. Unfortunetly users sometimes get email from wrong domain (users from Company B get emails with domain for Comapny A).
I think emails with that automatic header and buttons are composed by tamplate "mail.message_notification_email"
And there is a object called "button_access"
How do I make sure that they always get an email with urls from thier corresponding company domain?
Using Odoo13