Skip to Content
Menu
This question has been flagged
1 Reply
793 Views

Hi,

I would like to know if there is a way, graphically or in the code, to disable the sending of emails at project creation/update, while keeping the tracking of fields.


An example: when creating a project, I add a user as Project Manager of the project. When saving, the user receives the email below:

Dear ,
You have been assigned to the Project .


I first tried to pass the following arguments into the context with varying results:

  • tracking_disable=True: does not send an e-mail, but does not track changes anymore
  • mail_notrack=True: does not send an e-mail, but does not track changes anymore
  • mail_track_log_only=True: continues tracking, but also sends the email

I tried to find out how these emails are generated in the code, but I must admit that I got a bit lost and I can't find it.


Thank you in advance for your help,

Pedro

Avatar
Discard
Best Answer

HI Pedro,

Just inherit the project.task model and try to pass the context "mail_auto_subscribe_no_notify" as True. This will block the auto subscription message from project.task.

def write(self, vals):
res = super(Task, self.with_context(mail_auto_subscribe_no_notify=True)).write(vals)
return res
Avatar
Discard