summaryrefslogtreecommitdiff
path: root/addons/mail/models
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-05-09 21:07:44 +0200
committerChristophe Simonis <chs@odoo.com>2019-05-09 21:07:44 +0200
commitcc3a2c1bf3c8aa2a7f85b5c2f8eb4e9415f3e6c7 (patch)
treef97b6171e54f052126a1fad2f55a33c603e18bef /addons/mail/models
parent92cb648882082cc8d84d3bbe75304def5196998c (diff)
parente11bacfe512a3170f44d6d43646af914a9cf3b73 (diff)
[MERGE] forward port branch 12.0 up to e11bacfe512
Diffstat (limited to 'addons/mail/models')
-rw-r--r--addons/mail/models/ir_actions.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/mail/models/ir_actions.py b/addons/mail/models/ir_actions.py
index 40582b1d803..56f60069024 100644
--- a/addons/mail/models/ir_actions.py
+++ b/addons/mail/models/ir_actions.py
@@ -70,7 +70,7 @@ class ServerActions(models.Model):
@api.model
def run_action_followers_multi(self, action, eval_context=None):
- Model = self.env[action.model_id.model]
+ Model = self.env[action.model_name]
if self.partner_ids or self.channel_ids and hasattr(Model, 'message_subscribe'):
records = Model.browse(self._context.get('active_ids', self._context.get('active_id')))
records.message_subscribe(self.partner_ids.ids, self.channel_ids.ids)
@@ -83,7 +83,7 @@ class ServerActions(models.Model):
When need to know it to skip these steps.
Except if the computed field is supposed to trigger the action
"""
- records = self.env[action.model_id.model].browse(
+ records = self.env[action.model_name].browse(
self._context.get('active_ids', self._context.get('active_id')))
old_values = action._context.get('old_values')
if old_values:
@@ -112,6 +112,7 @@ class ServerActions(models.Model):
# with wrong values in subsequent operations
cleaned_ctx = dict(self.env.context)
cleaned_ctx.pop('default_type', None)
+ cleaned_ctx.pop('default_parent_id', None)
action.template_id.with_context(cleaned_ctx).send_mail(self._context.get('active_id'), force_send=False, raise_exception=False)
return False
@@ -120,7 +121,7 @@ class ServerActions(models.Model):
if not action.activity_type_id or not self._context.get('active_id') or self._is_recompute(action):
return False
- records = self.env[action.model_id.model].browse(self._context.get('active_ids', self._context.get('active_id')))
+ records = self.env[action.model_name].browse(self._context.get('active_ids', self._context.get('active_id')))
vals = {
'summary': action.activity_summary or '',