From 0b11ed87b6d428bc102ff3f258f3f635863cc60b Mon Sep 17 00:00:00 2001 From: Priyanka Kakadiya Date: Wed, 19 Jun 2019 12:37:51 +0000 Subject: [PATCH] [IMP] mail: keep old subtype subscription on change on parent record MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this commit, when changing subtype subscription from a parent record (e.g. project of task), then it does not update subtype subscription of existing records. Changes on parent record should only affect new record afterwards. Task-Id 1974055 Closes #34150 Signed-off-by: Alexandre Kühn (aku) --- addons/mail/models/mail_thread.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index bea8b37b867..0b7ac2b7b50 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -275,7 +275,7 @@ class MailThread(models.AbstractModel): for key, val in self._context.items(): if key.startswith('default_') and key[8:] not in create_values: create_values[key[8:]] = val - thread._message_auto_subscribe(create_values) + thread._message_auto_subscribe(create_values, followers_existing_policy='update') create_values_list[thread.id] = create_values # automatic logging unless asked not to (mainly for various testing purpose) @@ -2824,7 +2824,7 @@ class MailThread(models.AbstractModel): model_description=model_description, ) - def _message_auto_subscribe(self, updated_values): + def _message_auto_subscribe(self, updated_values, followers_existing_policy='skip'): """ Handle auto subscription. Auto subscription is done based on two main mechanisms @@ -2881,7 +2881,7 @@ class MailThread(models.AbstractModel): self._name, self.ids, list(new_partners), new_partners, list(new_channels), new_channels, - check_existing=True, existing_policy='skip') + check_existing=True, existing_policy=followers_existing_policy) # notify people from auto subscription, for example like assignation for (template, lang), pids in notify_data.items():