[REM] mail: remove useless link between message and shortcodes
There is a o2m / m2o link between mail.message and mail.shortcode. However this link is not used: 'messages' (m2o from shortcode to message) is never set. Anyway there is no usage of this link: shortcodes are replaced in message body and that's it. Task-3557985 (Mail: Message cleanup (shortcode, link)) Prepares Task-36879 (Mail: Support MultiCompany Aliases) Part-of: odoo/odoo#138938
This commit is contained in:
@@ -178,7 +178,6 @@ class Message(models.Model):
|
||||
# as the cache value for this inverse one2many is up-to-date.
|
||||
# Besides for new messages, and messages never sending emails, there was no mail, and it was searching for nothing.
|
||||
mail_ids = fields.One2many('mail.mail', 'mail_message_id', string='Mails', groups="base.group_system")
|
||||
canned_response_ids = fields.One2many('mail.shortcode', 'message_ids', string="Canned Responses", store=False)
|
||||
reaction_ids = fields.One2many('mail.message.reaction', 'message_id', string="Reactions", groups="base.group_system")
|
||||
|
||||
@api.depends('body', 'subject')
|
||||
|
||||
@@ -19,5 +19,4 @@ class MailShortcode(models.Model):
|
||||
substitution = fields.Text('Substitution', required=True,
|
||||
help="Content that will automatically replace the shortcut of your choosing. This content can still be adapted before sending your message.")
|
||||
description = fields.Char('Description')
|
||||
message_ids = fields.Many2one('mail.message', string="Messages", store=False)
|
||||
last_used = fields.Datetime('Last Used', help="Last time this shortcode was used")
|
||||
|
||||
@@ -2746,7 +2746,7 @@ class MailThread(models.AbstractModel):
|
||||
for values in values_list:
|
||||
create_values = dict(values)
|
||||
# Avoid warnings about non-existing fields
|
||||
for x in ('from', 'to', 'cc', 'canned_response_ids'):
|
||||
for x in ('from', 'to', 'cc'):
|
||||
create_values.pop(x, None)
|
||||
create_values['partner_ids'] = [Command.link(pid) for pid in (create_values.get('partner_ids') or [])]
|
||||
create_values_list.append(create_values)
|
||||
|
||||
@@ -499,7 +499,6 @@ class TestMessageNotify(TestMessagePostCommon):
|
||||
|
||||
for parameters in [
|
||||
{'message_type': 'comment'},
|
||||
{'canned_response_ids': []},
|
||||
{'child_ids': []},
|
||||
{'mail_ids': []},
|
||||
{'notification_ids': []},
|
||||
|
||||
Reference in New Issue
Block a user