summaryrefslogtreecommitdiff
path: root/addons/mail
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2019-07-10 14:59:37 +0200
committerAdrian Torres <adt@odoo.com>2019-07-17 14:13:12 +0200
commit4b38cc6590abcb58a0ca102a06063eb3db7ac1f4 (patch)
treecfd11739fc6b4c0cb4b23b54cc6badad4bf5c55e /addons/mail
parentf6fdde96bddfedf8764cd8a73089e44340d476ae (diff)
[REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly decorate methods with it, adds clutter and most people use it because they see that the rest of the code uses it. Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
Diffstat (limited to 'addons/mail')
-rw-r--r--addons/mail/models/ir_attachment.py1
-rw-r--r--addons/mail/models/ir_model.py1
-rw-r--r--addons/mail/models/mail_activity.py15
-rw-r--r--addons/mail/models/mail_alias.py6
-rw-r--r--addons/mail/models/mail_blacklist.py2
-rw-r--r--addons/mail/models/mail_cc_mixin.py2
-rw-r--r--addons/mail/models/mail_channel.py29
-rw-r--r--addons/mail/models/mail_followers.py3
-rw-r--r--addons/mail/models/mail_mail.py10
-rw-r--r--addons/mail/models/mail_message.py22
-rw-r--r--addons/mail/models/mail_message_subtype.py2
-rw-r--r--addons/mail/models/mail_notification.py1
-rw-r--r--addons/mail/models/mail_template.py8
-rw-r--r--addons/mail/models/mail_thread.py33
-rw-r--r--addons/mail/models/mail_tracking_value.py3
-rw-r--r--addons/mail/models/models.py1
-rw-r--r--addons/mail/models/res_company.py1
-rw-r--r--addons/mail/models/res_partner.py2
-rw-r--r--addons/mail/models/res_users.py4
-rw-r--r--addons/mail/models/update.py1
-rw-r--r--addons/mail/wizard/base_partner_merge.py1
-rw-r--r--addons/mail/wizard/email_template_preview.py1
-rw-r--r--addons/mail/wizard/invite.py1
-rw-r--r--addons/mail/wizard/mail_compose_message.py7
-rw-r--r--addons/mail/wizard/mail_resend_cancel.py2
-rw-r--r--addons/mail/wizard/mail_resend_message.py2
26 files changed, 0 insertions, 161 deletions
diff --git a/addons/mail/models/ir_attachment.py b/addons/mail/models/ir_attachment.py
index 4e0cfc4b0ea..c2dd7fe9f5b 100644
--- a/addons/mail/models/ir_attachment.py
+++ b/addons/mail/models/ir_attachment.py
@@ -7,7 +7,6 @@ from odoo import api, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
- @api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created through the controller
"""
diff --git a/addons/mail/models/ir_model.py b/addons/mail/models/ir_model.py
index b4950d73ed4..9451c4a59be 100644
--- a/addons/mail/models/ir_model.py
+++ b/addons/mail/models/ir_model.py
@@ -53,7 +53,6 @@ class IrModel(models.Model):
return super(IrModel, self).unlink()
- @api.multi
def write(self, vals):
if self and ('is_mail_thread' in vals or 'is_mail_activity' in vals or 'is_mail_blacklist' in vals):
if not all(rec.state == 'manual' for rec in self):
diff --git a/addons/mail/models/mail_activity.py b/addons/mail/models/mail_activity.py
index 97ef1011eff..566c994d75d 100644
--- a/addons/mail/models/mail_activity.py
+++ b/addons/mail/models/mail_activity.py
@@ -90,7 +90,6 @@ class MailActivityType(models.Model):
for activity_type in self:
activity_type.initial_res_model_id = activity_type.res_model_id
- @api.multi
def unlink(self):
if any(self.get_external_id().values()):
raise exceptions.ValidationError("You can not delete activity type that are used as master data.")
@@ -160,13 +159,11 @@ class MailActivity(models.Model):
# access
can_write = fields.Boolean(compute='_compute_can_write', help='Technical field to hide buttons if the current user has no access.')
- @api.multi
@api.onchange('previous_activity_type_id')
def _compute_has_recommended_activities(self):
for record in self:
record.has_recommended_activities = bool(record.previous_activity_type_id.next_type_ids)
- @api.multi
@api.onchange('previous_activity_type_id')
def _onchange_previous_activity_type_id(self):
for record in self:
@@ -226,7 +223,6 @@ class MailActivity(models.Model):
if self.recommended_activity_type_id:
self.activity_type_id = self.recommended_activity_type_id
- @api.multi
def _filter_access_rules(self, operation):
""" Return the subset of ``self`` for which ``operation`` is allowed.
A custom implementation is done on activities as this document has some
@@ -282,7 +278,6 @@ class MailActivity(models.Model):
return valid
- @api.multi
def _check_access_assignation(self):
""" Check assigned user (user_id field) has access to the document. Purpose
is to allow assigned user to handle their activities. For that purpose
@@ -334,7 +329,6 @@ class MailActivity(models.Model):
{'type': 'activity_updated', 'activity_created': True})
return activity
- @api.multi
def write(self, values):
if values.get('user_id'):
user_changes = self.filtered(lambda activity: activity.user_id.id != values.get('user_id'))
@@ -361,7 +355,6 @@ class MailActivity(models.Model):
{'type': 'activity_updated', 'activity_deleted': True})
return res
- @api.multi
def unlink(self):
for activity in self:
if activity.date_deadline <= fields.Date.today():
@@ -374,7 +367,6 @@ class MailActivity(models.Model):
# Business Methods
# ------------------------------------------------------
- @api.multi
def action_notify(self):
if not self:
return
@@ -397,14 +389,12 @@ class MailActivity(models.Model):
email_layout_xmlid='mail.mail_notification_light',
)
- @api.multi
def action_done(self):
""" Wrapper without feedback because web button add context as
parameter, therefore setting context to feedback """
messages, next_activities = self._action_done()
return messages.ids and messages.ids[0] or False
- @api.multi
def action_feedback(self, feedback=False, attachment_ids=None):
messages, next_activities = self._action_done(feedback=feedback, attachment_ids=attachment_ids)
return messages.ids and messages.ids[0] or False
@@ -414,7 +404,6 @@ class MailActivity(models.Model):
parameter, therefore setting context to feedback """
return self.action_feedback_schedule_next()
- @api.multi
def action_feedback_schedule_next(self, feedback=False):
ctx = dict(
clean_context(self.env.context),
@@ -485,7 +474,6 @@ class MailActivity(models.Model):
return messages, next_activities
- @api.multi
def action_close_dialog(self):
return {'type': 'ir.actions.act_window_close'}
@@ -636,7 +624,6 @@ class MailActivityMixin(models.AbstractModel):
def _search_activity_summary(self, operator, operand):
return [('activity_ids.summary', operator, operand)]
- @api.multi
def write(self, vals):
# Delete activities of archived record.
if 'active' in vals and vals['active'] is False:
@@ -645,7 +632,6 @@ class MailActivityMixin(models.AbstractModel):
).unlink()
return super(MailActivityMixin, self).write(vals)
- @api.multi
def unlink(self):
""" Override unlink to delete records activities through (res_model, res_id). """
record_ids = self.ids
@@ -655,7 +641,6 @@ class MailActivityMixin(models.AbstractModel):
).unlink()
return result
- @api.multi
def toggle_active(self):
""" Before archiving the record we should also remove its ongoing
activities. Otherwise they stay in the systray and concerning archived
diff --git a/addons/mail/models/mail_alias.py b/addons/mail/models/mail_alias.py
index ecf03c3c5a3..2a8b9c6bde8 100644
--- a/addons/mail/models/mail_alias.py
+++ b/addons/mail/models/mail_alias.py
@@ -73,7 +73,6 @@ class Alias(models.Model):
('alias_unique', 'UNIQUE(alias_name)', 'Unfortunately this email alias is already used, please choose a unique one')
]
- @api.multi
def _get_alias_domain(self):
alias_domain = self.env["ir.config_parameter"].sudo().get_param("mail.catchall.domain")
for record in self:
@@ -107,14 +106,12 @@ class Alias(models.Model):
vals['alias_parent_model_id'] = model.id
return super(Alias, self).create(vals)
- @api.multi
def write(self, vals):
""""give a unique alias name if given alias name is already assigned"""
if vals.get('alias_name') and self.ids:
vals['alias_name'] = self._clean_and_make_unique(vals.get('alias_name'), alias_ids=self.ids)
return super(Alias, self).write(vals)
- @api.multi
def name_get(self):
"""Return the mail alias display alias_name, including the implicit
mail catchall domain if exists from config otherwise "New Alias".
@@ -154,7 +151,6 @@ class Alias(models.Model):
name = re.sub(r'[^\w+.]+', '-', name)
return self._find_unique(name, alias_ids=alias_ids)
- @api.multi
def open_document(self):
if not self.alias_model_id or not self.alias_force_thread_id:
return False
@@ -165,7 +161,6 @@ class Alias(models.Model):
'type': 'ir.actions.act_window',
}
- @api.multi
def open_parent_document(self):
if not self.alias_parent_model_id or not self.alias_parent_thread_id:
return False
@@ -212,7 +207,6 @@ class AliasMixin(models.AbstractModel):
record.alias_id.sudo().write(record.get_alias_values())
return record
- @api.multi
def unlink(self):
""" Delete the given records, and cascade-delete their corresponding alias. """
aliases = self.mapped('alias_id')
diff --git a/addons/mail/models/mail_blacklist.py b/addons/mail/models/mail_blacklist.py
index 4311aa54b6e..f2e8dddb65c 100644
--- a/addons/mail/models/mail_blacklist.py
+++ b/addons/mail/models/mail_blacklist.py
@@ -50,7 +50,6 @@ class MailBlackList(models.Model):
results = super(MailBlackList, self).create(to_create)
return self.env['mail.blacklist'].browse(bl_entries.values()) | results
- @api.multi
def write(self, values):
if 'email' in values:
values['email'] = tools.email_normalize(values['email'])
@@ -151,7 +150,6 @@ class MailBlackListMixin(models.AbstractModel):
for record in self:
record.is_blacklisted = record.email_normalized in blacklist
- @api.multi
def _message_receive_bounce(self, email, partner, mail_id=None):
""" Override of mail.thread generic method. Purpose is to increment the
bounce counter of the record. """
diff --git a/addons/mail/models/mail_cc_mixin.py b/addons/mail/models/mail_cc_mixin.py
index 88e16f7d6b8..cc1554fcff5 100644
--- a/addons/mail/models/mail_cc_mixin.py
+++ b/addons/mail/models/mail_cc_mixin.py
@@ -29,7 +29,6 @@ class MailCCMixin(models.AbstractModel):
cc_values.update(custom_values)
return super(MailCCMixin, self).message_new(msg_dict, cc_values)
- @api.multi
def message_update(self, msg_dict, update_vals=None):
'''Adds cc email to self.email_cc while trying to keep email as raw as possible but unique'''
if update_vals is None:
@@ -43,7 +42,6 @@ class MailCCMixin(models.AbstractModel):
cc_values.update(update_vals)
return super(MailCCMixin, self).message_update(msg_dict, cc_values)
- @api.multi
def _message_get_suggested_recipients(self):
recipients = super(MailCCMixin, self)._message_get_suggested_recipients()
for record in self:
diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py
index cbc548825d9..2b56951fb4f 100644
--- a/addons/mail/models/mail_channel.py
+++ b/addons/mail/models/mail_channel.py
@@ -134,13 +134,11 @@ class Channel(models.Model):
for channel in self:
channel.is_subscribed = self.env.user.partner_id in channel.channel_partner_ids
- @api.multi
@api.depends('moderator_ids')
def _compute_is_moderator(self):
for channel in self:
channel.is_moderator = self.env.user in channel.moderator_ids
- @api.multi
@api.depends('moderation_ids')
def _compute_moderation_count(self):
read_group_res = self.env['mail.moderation'].read_group([('channel_id', 'in', self.ids)], ['channel_id'], 'channel_id')
@@ -169,7 +167,6 @@ class Channel(models.Model):
if any(not channel.moderator_ids for channel in self if channel.moderation):
raise ValidationError('Moderated channels must have moderators.')
- @api.multi
def _compute_is_member(self):
memberships = self.env['mail.channel.partner'].sudo().search([
('channel_id', 'in', self.ids),
@@ -179,7 +176,6 @@ class Channel(models.Model):
for record in self:
record.is_member = record in membership_ids
- @api.multi
def _compute_is_chat(self):
for record in self:
if record.channel_type == 'chat':
@@ -233,7 +229,6 @@ class Channel(models.Model):
return channel
- @api.multi
def unlink(self):
aliases = self.mapped('alias_id')
@@ -249,7 +244,6 @@ class Channel(models.Model):
aliases.sudo().unlink()
return res
- @api.multi
def write(self, vals):
# First checks if user tries to modify moderation fields and has not the right to do it.
if any(key for key in MODERATION_FIELDS if vals.get(key)) and any(self.env.user not in channel.moderator_ids for channel in self if channel.moderation):
@@ -279,7 +273,6 @@ class Channel(models.Model):
for mail_channel in self:
mail_channel.write({'channel_partner_ids': [(4, pid) for pid in mail_channel.mapped('group_ids').mapped('users').mapped('partner_id').ids]})
- @api.multi
def action_follow(self):
self.ensure_one()
channel_partner = self.mapped('channel_last_seen_partner_ids').filtered(lambda cp: cp.partner_id == self.env.user.partner_id)
@@ -287,11 +280,9 @@ class Channel(models.Model):
return self.write({'channel_last_seen_partner_ids': [(0, 0, {'partner_id': self.env.user.partner_id.id})]})
return False
- @api.multi
def action_unfollow(self):
return self._action_unfollow(self.env.user.partner_id)
- @api.multi
def _action_unfollow(self, partner):
channel_info = self.channel_info('unsubscribe')[0] # must be computed before leaving the channel (access rights)
result = self.write({'channel_partner_ids': [(3, partner.id)]})
@@ -302,7 +293,6 @@ class Channel(models.Model):
self.sudo().message_post(body=notification, subtype="mail.mt_comment", author_id=partner.id)
return result
- @api.multi
def _notify_get_groups(self):
""" All recipients of a message on a channel are considered as partners.
This means they will receive a minimal email, without a link to access
@@ -314,7 +304,6 @@ class Channel(models.Model):
groups[index] = (group_name, lambda partner: False, group_data)
return groups
- @api.multi
def _notify_email_header_dict(self):
headers = super(Channel, self)._notify_email_header_dict()
headers['Precedence'] = 'list'
@@ -330,7 +319,6 @@ class Channel(models.Model):
headers['X-Forge-To'] = list_to
return headers
- @api.multi
def _message_receive_bounce(self, email, partner, mail_id=None):
""" Override bounce management to unsubscribe bouncing addresses """
for p in partner:
@@ -338,7 +326,6 @@ class Channel(models.Model):
self._action_unfollow(p)
return super(Channel, self)._message_receive_bounce(email, partner, mail_id=mail_id)
- @api.multi
def _notify_email_recipient_values(self, recipient_ids):
# Excluded Blacklisted
whitelist = self.env['res.partner'].sudo().browse(recipient_ids).filtered(lambda p: not p.is_blacklisted)
@@ -377,7 +364,6 @@ class Channel(models.Model):
moderation_status = 'pending_moderation'
return moderation_status, email
- @api.multi
@api.returns('mail.message', lambda value: value.id)
def message_post(self, message_type='notification', **kwargs):
moderation_status, email = self._extract_moderation_values(message_type, **kwargs)
@@ -419,7 +405,6 @@ class Channel(models.Model):
# Moderation
# --------------------------------------------------
- @api.multi
def send_guidelines(self):
""" Send guidelines to all channel members. """
if self.env.user in self.moderator_ids or self.env.user.has_group('base.group_system'):
@@ -429,7 +414,6 @@ class Channel(models.Model):
else:
raise UserError("Only an administrator or a moderator can send guidelines to channel members!")
- @api.multi
def _send_guidelines(self, partners):
""" Send guidelines of a given channel. Returns False if template used for guidelines
not found. Caller may have to handle this return value. """
@@ -453,7 +437,6 @@ class Channel(models.Model):
mail.send()
return True
- @api.multi
def _update_moderation_email(self, emails, status):
""" This method adds emails into either white or black of the channel list of emails
according to status. If an email in emails is already moderated, the method updates the email status.
@@ -481,7 +464,6 @@ class Channel(models.Model):
# - when a message is posted on a channel (to the channel, using _notify() method)
# Anonymous method
- @api.multi
def _broadcast(self, partner_ids):
""" Broadcast the current channel header to the given partner ids
:param partner_ids : the partner to notify
@@ -489,7 +471,6 @@ class Channel(models.Model):
notifications = self._channel_channel_notifications(partner_ids)
self.env['bus.bus'].sendmany(notifications)
- @api.multi
def _channel_channel_notifications(self, partner_ids):
""" Generate the bus notifications of current channel for the given partner ids
:param partner_ids : the partner to send the current channel header
@@ -510,7 +491,6 @@ class Channel(models.Model):
else:
message._notify_pending_by_chat()
- @api.multi
def _channel_message_notifications(self, message, message_format=False):
""" Generate the bus notifications for the given message
:param message : the mail.message to sent
@@ -545,7 +525,6 @@ class Channel(models.Model):
partner_infos[user.partner_id.id]['out_of_office_message'] = user.out_of_office_message
return partner_infos
- @api.multi
def channel_info(self, extra_info=False):
""" Get the informations header for the current channels
:returns a list of channels values
@@ -629,7 +608,6 @@ class Channel(models.Model):
channel_infos.append(info)
return channel_infos
- @api.multi
def channel_fetch_message(self, last_id=False, limit=20):
""" Return message values of the current channel.
:param last_id : last message id to start the research
@@ -737,7 +715,6 @@ class Channel(models.Model):
if channel_partners:
channel_partners.write({'is_pinned': pinned})
- @api.multi
def channel_seen(self):
self.ensure_one()
if self.channel_message_ids.ids:
@@ -762,7 +739,6 @@ class Channel(models.Model):
self.env['bus.bus'].sendone((self._cr.dbname, 'res.partner', self.env.user.partner_id.id), data)
return last_message_id
- @api.multi
def channel_fetched(self):
""" Broadcast the channel_fetched notification to channel members
:param channel_ids : list of channel id that has been fetched by current user
@@ -787,7 +763,6 @@ class Channel(models.Model):
}
self.env['bus.bus'].sendmany([[(self._cr.dbname, 'mail.channel', channel.id), data]])
- @api.multi
def channel_invite(self, partner_ids):
""" Add the given partner_ids to the current channels and broadcast the channel header to them.
:param partner_ids : list of partner id to add
@@ -820,7 +795,6 @@ class Channel(models.Model):
'custom_channel_name': name,
})
- @api.multi
def notify_typing(self, is_typing, is_website_user=False):
""" Broadcast the typing notification to channel members
:param is_typing: (boolean) tells whether the current user is typing or not
@@ -884,7 +858,6 @@ class Channel(models.Model):
domain = expression.AND([domain, [('name', 'ilike', '%'+name+'%')]])
return self.search(domain).read(['name', 'public', 'uuid', 'channel_type'])
- @api.multi
def channel_join_and_get_info(self):
self.ensure_one()
added = self.action_follow()
@@ -949,7 +922,6 @@ class Channel(models.Model):
def _channel_fetch_listeners_where_clause(self, uuid):
return ("C.uuid = %s", (uuid,))
- @api.multi
def channel_fetch_preview(self):
""" Return the last message of the given channels """
if not self:
@@ -984,7 +956,6 @@ class Channel(models.Model):
commands.append(command)
return commands
- @api.multi
def execute_command(self, command='', **kwargs):
""" Executes a given command """
self.ensure_one()
diff --git a/addons/mail/models/mail_followers.py b/addons/mail/models/mail_followers.py
index 417b83e59f5..87f20af46d1 100644
--- a/addons/mail/models/mail_followers.py
+++ b/addons/mail/models/mail_followers.py
@@ -36,7 +36,6 @@ class Followers(models.Model):
'mail.message.subtype', string='Subtype',
help="Message subtypes followed, meaning subtypes that will be pushed onto the user's Wall.")
- @api.multi
def _invalidate_documents(self, vals_list=None):
""" Invalidate the cache of the documents followed by ``self``.
@@ -57,7 +56,6 @@ class Followers(models.Model):
res._invalidate_documents(vals_list)
return res
- @api.multi
def write(self, vals):
if 'res_model' in vals or 'res_id' in vals:
self._invalidate_documents()
@@ -66,7 +64,6 @@ class Followers(models.Model):
self._invalidate_documents()
return res
- @api.multi
def unlink(self):
self._invalidate_documents()
return super(Followers, self).unlink()
diff --git a/addons/mail/models/mail_mail.py b/addons/mail/models/mail_mail.py
index f9069021307..e6d2506c00a 100644
--- a/addons/mail/models/mail_mail.py
+++ b/addons/mail/models/mail_mail.py
@@ -70,7 +70,6 @@ class MailMail(models.Model):
new_mail.attachment_ids.check(mode='read')
return new_mail
- @api.multi
def write(self, vals):
res = super(MailMail, self).write(vals)
if vals.get('attachment_ids'):
@@ -78,7 +77,6 @@ class MailMail(models.Model):
mail.attachment_ids.check(mode='read')
return res
- @api.multi
def unlink(self):
# cascade-delete the parent message for all mails that are not created for a notification
mail_msg_cascade_ids = [mail.mail_message_id.id for mail in self if not mail.notification]
@@ -95,11 +93,9 @@ class MailMail(models.Model):
self = self.with_context(dict(self._context, default_type=None))
return super(MailMail, self).default_get(fields)
- @api.multi
def mark_outgoing(self):
return self.write({'state': 'outgoing'})
- @api.multi
def cancel(self):
return self.write({'state': 'cancel'})
@@ -142,7 +138,6 @@ class MailMail(models.Model):
_logger.exception("Failed processing mail queue")
return res
- @api.multi
def _postprocess_sent_message(self, success_pids, failure_reason=False, failure_type=None):
"""Perform any post-processing necessary after sending ``mail``
successfully, including deleting it completely along with its
@@ -184,14 +179,12 @@ class MailMail(models.Model):
# mail_mail formatting, tools and send mechanism
# ------------------------------------------------------
- @api.multi
def _send_prepare_body(self):
"""Return a specific ir_email body. The main purpose of this method
is to be inherited to add custom content depending on some module."""
self.ensure_one()
return self.body_html or ''
- @api.multi
def _send_prepare_values(self, partner=None):
"""Return a dictionary for specific email values, depending on a
partner, or generic to the whole recipients given by mail.email_to.
@@ -212,7 +205,6 @@ class MailMail(models.Model):
}
return res
- @api.multi
def _split_by_server(self):
"""Returns an iterator of pairs `(mail_server_id, record_ids)` for current recordset.
@@ -230,7 +222,6 @@ class MailMail(models.Model):
for mail_batch in tools.split_every(batch_size, record_ids):
yield server_id, mail_batch
- @api.multi
def send(self, auto_commit=False, raise_exception=False):
""" Sends the selected emails immediately, ignoring their current
state (mails that have already been sent should not be passed
@@ -271,7 +262,6 @@ class MailMail(models.Model):
if smtp_session:
smtp_session.quit()
- @api.multi
def _send(self, auto_commit=False, raise_exception=False, smtp_session=None):
IrMailServer = self.env['ir.mail_server']
IrAttachment = self.env['ir.attachment']
diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py
index 45b71613a85..229fdb943eb 100644
--- a/addons/mail/models/mail_message.py
+++ b/addons/mail/models/mail_message.py
@@ -129,7 +129,6 @@ class Message(models.Model):
email_layout_xmlid = fields.Char('Layout', copy=False, oldname='layout') # xml id of layout
add_sign = fields.Boolean(default=True)
- @api.multi
def _get_needaction(self):
""" Need action on a mail.message = notified on my channel """
my_messages = self.env['mail.notification'].sudo().search([
@@ -145,7 +144,6 @@ class Message(models.Model):
return ['&', ('notification_ids.res_partner_id', '=', self.env.user.partner_id.id), ('notification_ids.is_read', '=', False)]
return ['&', ('notification_ids.res_partner_id', '=', self.env.user.partner_id.id), ('notification_ids.is_read', '=', True)]
- @api.multi
def _compute_has_error(self):
error_from_notification = self.env['mail.notification'].sudo().search([
('mail_message_id', 'in', self.ids),
@@ -153,7 +151,6 @@ class Message(models.Model):
for message in self:
message.has_error = message in error_from_notification
- @api.multi
def _search_has_error(self, operator, operand):
if operator == '=' and operand:
return [('notification_ids.notification_status', 'in', ('bounce', 'exception'))]
@@ -173,7 +170,6 @@ class Message(models.Model):
return [('starred_partner_ids', 'in', [self.env.user.partner_id.id])]
return [('starred_partner_ids', 'not in', [self.env.user.partner_id.id])]
- @api.multi
def _compute_need_moderation(self):
for message in self:
message.need_moderation = False
@@ -237,7 +233,6 @@ class Message(models.Model):
return ids
- @api.multi
def set_message_done(self):
""" Remove the needaction from messages for the current partner. """
partner_id = self.env.user.partner_id
@@ -290,7 +285,6 @@ class Message(models.Model):
notification = {'type': 'toggle_star', 'message_ids': ids, 'starred': False}
self.env['bus.bus'].sendone((self._cr.dbname, 'res.partner', self.env.user.partner_id.id), notification)
- @api.multi
def toggle_message_starred(self):
""" Toggle messages as (un)starred. Technically, the notifications related
to uid are set to (un)starred.
@@ -415,7 +409,6 @@ class Message(models.Model):
return True
- @api.multi
def message_fetch_failed(self):
messages = self.search([
('has_error', '=', True),
@@ -452,7 +445,6 @@ class Message(models.Model):
messages = messages.sorted(key='id', reverse=True)[:limit]
return messages.message_format()
- @api.multi
def message_format(self):
""" Get the message values in the format for web client. Since message values can be broadcasted,
computed fields MUST NOT BE READ and broadcasted.
@@ -527,7 +519,6 @@ class Message(models.Model):
message['module_icon'] = modules.module.get_module_icon(self.env[message['model']]._original_module)
return message_values
- @api.multi
def _get_message_format_fields(self):
return [
'id', 'body', 'date', 'author_id', 'email_from', # base message fields
@@ -550,7 +541,6 @@ class Message(models.Model):
'module_icon': '/mail/static/src/img/smiley/mailfailure.jpg',
}
- @api.multi
def _format_mail_failures(self):
""" A shorter message to notify a failure update """
failures_infos = []
@@ -574,7 +564,6 @@ class Message(models.Model):
failures_infos.append(info)
return failures_infos
- @api.multi
def _notify_mail_failure_update(self):
messages = self.env['mail.message']
for message in self:
@@ -606,7 +595,6 @@ class Message(models.Model):
if not self._cr.fetchone():
self._cr.execute("""CREATE INDEX mail_message_model_res_id_idx ON mail_message (model, res_id)""")
- @api.multi
def is_thread_message(self, vals=None):
if vals:
res_id = vals.get('res_id')
@@ -713,7 +701,6 @@ class Message(models.Model):
id_list = [id for id in ids if id in final_ids]
return id_list
- @api.multi
def check_access_rule(self, operation):
""" Access rules of mail.message:
- read: if
@@ -1010,7 +997,6 @@ class Message(models.Model):
message_id = tools.generate_tracking_message_id('private')
return message_id
- @api.multi
def _invalidate_documents(self, model=None, res_id=None):
""" Invalidate the cache of the documents followed by ``self``. """
for record in self:
@@ -1100,14 +1086,12 @@ class Message(models.Model):
return message
- @api.multi
def read(self, fields=None, load='_classic_read'):
""" Override to explicitely call check_access_rule, that is not called
by the ORM. It instead directly fetches ir.rules and apply them. """
self.check_access_rule('read')
return super(Message, self).read(fields=fields, load=load)
- @api.multi
def write(self, vals):
record_changed = 'model' in vals or 'res_id' in vals
if record_changed or 'message_type' in vals:
@@ -1120,7 +1104,6 @@ class Message(models.Model):
self._invalidate_documents()
return res
- @api.multi
def unlink(self):
# cascade-delete attachments that are directly attached to the message (should only happen
# for mail.messages that act as parent for a standalone mail.mail record).
@@ -1139,7 +1122,6 @@ class Message(models.Model):
# Moderation
# --------------------------------------------------
- @api.multi
def moderate(self, decision, **kwargs):
""" Moderate messages. A check is done on moderation status of the
current user to ensure we only moderate valid messages. """
@@ -1151,7 +1133,6 @@ class Message(models.Model):
if to_moderate:
self.browse(to_moderate)._moderate(decision, **kwargs)
- @api.multi
def _moderate(self, decision, **kwargs):
""" :param decision
* accept - moderate message and broadcast that message to followers of relevant channels.
@@ -1200,7 +1181,6 @@ class Message(models.Model):
# message will always be a thread_message. This check should always be true.
self.env[message.model].browse(message.res_id)._notify_thread(message)
- @api.multi
def _moderate_send_reject_email(self, subject, comment):
for msg in self:
if not msg.email_from:
@@ -1221,7 +1201,6 @@ class Message(models.Model):
}
self.env['mail.mail'].sudo().create(vals)
- @api.multi
def _search_from_same_authors(self):
""" Returns all pending moderation messages that have same email_from and
same res_id as given recordset. """
@@ -1235,7 +1214,6 @@ class Message(models.Model):
])
return messages
- @api.multi
def _moderate_discard(self):
""" Notify deletion of messages to their moderators and authors and then delete them.
"""
diff --git a/addons/mail/models/mail_message_subtype.py b/addons/mail/models/mail_message_subtype.py
index 9c800793b47..43922018e89 100644
--- a/addons/mail/models/mail_message_subtype.py
+++ b/addons/mail/models/mail_message_subtype.py
@@ -46,12 +46,10 @@ class MailMessageSubtype(models.Model):
self.clear_caches()
return super(MailMessageSubtype, self).create(vals)
- @api.multi
def write(self, vals):
self.clear_caches()
return super(MailMessageSubtype, self).write(vals)
- @api.multi
def unlink(self):
self.clear_caches()
return super(MailMessageSubtype, self).unlink()
diff --git a/addons/mail/models/mail_notification.py b/addons/mail/models/mail_notification.py
index 571023450d9..c89ce0fd57d 100644
--- a/addons/mail/models/mail_notification.py
+++ b/addons/mail/models/mail_notification.py
@@ -51,7 +51,6 @@ class Notification(models.Model):
if not self._cr.fetchone():
self._cr.execute('CREATE INDEX mail_notification_res_partner_id_is_read_notification_status_mail_message_id ON mail_message_res_partner_needaction_rel (res_partner_id, is_read, notification_status, mail_message_id)')
- @api.multi
def format_failure_reason(self):
self.ensure_one()
if self.failure_type != 'UNKNOWN':
diff --git a/addons/mail/models/mail_template.py b/addons/mail/models/mail_template.py
index e657e146837..cfcc72b08b3 100644
--- a/addons/mail/models/mail_template.py
+++ b/addons/mail/models/mail_template.py
@@ -194,26 +194,22 @@ class MailTemplate(models.Model):
self.sub_model_object_field = False
self.null_value = False
- @api.multi
def unlink(self):
self.unlink_action()
return super(MailTemplate, self).unlink()
- @api.multi
@api.returns('self', lambda value: value.id)
def copy(self, default=None):
default = dict(default or {},
name=_("%s (copy)") % self.name)
return super(MailTemplate, self).copy(default=default)
- @api.multi
def unlink_action(self):
for template in self:
if template.ref_ir_act_window:
template.ref_ir_act_window.unlink()
return True
- @api.multi
def create_action(self):
ActWindow = self.env['ir.actions.act_window']
view = self.env.ref('mail.email_compose_message_wizard_form')
@@ -302,7 +298,6 @@ class MailTemplate(models.Model):
return multi_mode and results or results[res_ids[0]]
- @api.multi
def get_email_template(self, res_ids):
multi_mode = True
if isinstance(res_ids, int):
@@ -332,7 +327,6 @@ class MailTemplate(models.Model):
return multi_mode and results or results[res_ids[0]]
- @api.multi
def generate_recipients(self, results, res_ids):
"""Generates the recipients of the template. Default values can ben generated
instead of the template values if requested by template or context.
@@ -370,7 +364,6 @@ class MailTemplate(models.Model):
results[res_id]['partner_ids'] = partner_ids
return results
- @api.multi
def generate_email(self, res_ids, fields=None):
"""Generates an email from the template for given the given model based on
records given by res_ids.
@@ -463,7 +456,6 @@ class MailTemplate(models.Model):
# EMAIL
# ----------------------------------------
- @api.multi
def send_mail(self, res_id, force_send=False, raise_exception=False, email_values=None, notif_layout=False):
""" Generates a new mail.mail. Template is rendered on record given by
res_id and model coming from template.
diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py
index 8a53e51cba2..37720077b66 100644
--- a/addons/mail/models/mail_thread.py
+++ b/addons/mail/models/mail_thread.py
@@ -148,7 +148,6 @@ class MailThread(models.AbstractModel):
# using read() below is much faster than followers.mapped('res_id')
return [('id', 'in', [res['res_id'] for res in followers.read(['res_id'])])]
- @api.multi
@api.depends('message_follower_ids')
def _compute_is_follower(self):
followers = self.env['mail.followers'].sudo().search([
@@ -175,7 +174,6 @@ class MailThread(models.AbstractModel):
# using read() below is much faster than followers.mapped('res_id')
return [('id', 'not in', [res['res_id'] for res in followers.read(['res_id'])])]
- @api.multi
def _get_message_unread(self):
partner_id = self.env.user.partner_id.id
res = dict.fromkeys(self.ids, 0)
@@ -199,7 +197,6 @@ class MailThread(models.AbstractModel):
record.message_unread_counter = res.get(record._origin.id, 0)
record.message_unread = bool(record.message_unread_counter)
- @api.multi
def _get_message_needaction(self):
res = dict.fromkeys(self.ids, 0)
if self.ids:
@@ -220,7 +217,6 @@ class MailThread(models.AbstractModel):
def _search_message_needaction(self, operator, operand):
return [('message_ids.needaction', operator, operand)]
- @api.multi
def _compute_message_has_error(self):
res = {}
if self.ids:
@@ -240,7 +236,6 @@ class MailThread(models.AbstractModel):
def _search_message_has_error(self, operator, operand):
return ['&', ('message_ids.has_error', operator, operand), ('message_ids.author_id', '=', self.env.user.partner_id.id)]
- @api.multi
def _compute_message_attachment_count(self):
read_group_var = self.env['ir.attachment'].read_group([('res_id', 'in', self.ids), ('res_model', '=', self._name)],
fields=['res_id'],
@@ -308,7 +303,6 @@ class MailThread(models.AbstractModel):
return threads
- @api.multi
def write(self, values):
if self._context.get('tracking_disable'):
return super(MailThread, self).write(values)
@@ -337,7 +331,6 @@ class MailThread(models.AbstractModel):
track_self._message_track_post_template(changes)
return result
- @api.multi
def unlink(self):
""" Override unlink to delete messages and followers. This cannot be
cascaded, because link is done through (res_model, res_id). """
@@ -350,7 +343,6 @@ class MailThread(models.AbstractModel):
).unlink()
return res
- @api.multi
def copy_data(self, default=None):
# avoid tracking multiple temporary changes during copy
return super(MailThread, self.with_context(mail_notrack=True)).copy_data(default=default)
@@ -507,7 +499,6 @@ class MailThread(models.AbstractModel):
check_operation = operation
return check_operation
- @api.multi
def message_change_thread(self, new_thread):
"""
Transfer the list of the mail thread messages from an model to another
@@ -567,7 +558,6 @@ class MailThread(models.AbstractModel):
:returns: a subtype browse record or False if no subtype is trigerred
"""
- @api.multi
def _track_subtype(self, init_values):
""" Give the subtypes triggered by the changes on the record according
to values that have been updated.
@@ -579,11 +569,9 @@ class MailThread(models.AbstractModel):
"""
return False
- @api.multi
def _track_template(self, changes):
return dict()
- @api.multi
def _message_track_post_template(self, changes):
if not changes:
return True
@@ -597,7 +585,6 @@ class MailThread(models.AbstractModel):
self.message_post_with_template(template.id, **post_kwargs)
return True
- @api.multi
def _message_track(self, tracked_fields, initial):
""" For a given record, fields to check (tuple column name, column info)
and initial values, return a structure that is a tuple containing :
@@ -625,7 +612,6 @@ class MailThread(models.AbstractModel):
return changes, tracking_value_ids
- @api.multi
def message_track(self, tracked_fields, initial_values):
""" Track updated values. Comparing the initial and current values of
the fields given in tracked_fields, it generates a message containing
@@ -1177,7 +1163,6 @@ class MailThread(models.AbstractModel):
data[name_field] = msg_dict.get('subject', '')
return self.create(data)
- @api.multi
def message_update(self, msg_dict, update_vals=None):
"""Called by ``message_process`` when a new message is received
for an existing thread. The default behavior is to update the record
@@ -1195,7 +1180,6 @@ class MailThread(models.AbstractModel):
self.write(update_vals)
return True
- @api.multi
def _message_receive_bounce(self, email, partner, mail_id=None):
"""Called by ``message_process`` when a bounce email (such as Undelivered
Mail Returned to Sender) is received for an existing thread. The default
@@ -1439,7 +1423,6 @@ class MailThread(models.AbstractModel):
res[record.id] = {'partner_ids': recipient_ids, 'email_to': email_to, 'email_cc': email_cc}
return res
- @api.multi
def _message_add_suggested_recipient(self, result, partner=None, email=None, reason=''):
""" Called by _message_get_suggested_recipients, to add a suggested
recipient in the result dictionary. The form is :
@@ -1464,7 +1447,6 @@ class MailThread(models.AbstractModel):
result[self.ids[0]].append((False, email, reason))
return result
- @api.multi
def _message_get_suggested_recipients(self):
""" Returns suggested recipients for ids. Those are a list of
tuple (partner_id, partner_name, reason), to be managed by Chatter. """
@@ -1547,7 +1529,6 @@ class MailThread(models.AbstractModel):
partners.append(partner)
return partners
- @api.multi
def _message_partner_info_from_emails(self, emails, link_mail=False):
""" Convert a list of emails into a list partner_ids and a list
new_partner_ids. The return value is non conventional because
@@ -1672,7 +1653,6 @@ class MailThread(models.AbstractModel):
return_values['attachment_ids'] = m2m_attachment_ids
return return_values
- @api.multi
@api.returns('mail.message', lambda value: value.id)
def message_post(self,
body='', subject=None, message_type='notification',
@@ -1809,7 +1789,6 @@ class MailThread(models.AbstractModel):
using already-computed values instead of having to rebrowse things. """
pass
- @api.multi
def message_post_with_view(self, views_or_xmlid, **kwargs):
""" Helper method to send a mail / post a message using a view_id to
render using the ir.qweb engine. This method is stand alone, because
@@ -1834,7 +1813,6 @@ class MailThread(models.AbstractModel):
kwargs['body'] = rendered_template
record.message_post_with_template(False, **kwargs)
- @api.multi
def message_post_with_template(self, template_id, email_layout_xmlid=None, **kwargs):
""" Helper method to send a mail with a template
:param template_id : the id of the template to render to create the body of the message
@@ -1976,7 +1954,6 @@ class MailThread(models.AbstractModel):
# Notification API
# ------------------------------------------------------
- @api.multi
def _notify_thread(self, message, msg_vals=False, **kwargs):
""" Main notification method. This method basically does two things
@@ -2252,7 +2229,6 @@ class MailThread(models.AbstractModel):
'lang': lang,
}
- @api.multi
def _notify_compute_recipients(self, message, msg_vals):
""" Compute recipients to notify based on subtype and followers. This
method returns data structured as expected for ``_notify_recipients``. """
@@ -2321,7 +2297,6 @@ class MailThread(models.AbstractModel):
hm = hmac.new(secret.encode('utf-8'), token.encode('utf-8'), hashlib.sha1).hexdigest()
return hm
- @api.multi
def _notify_get_action_link(self, link_type, **kwargs):
local_kwargs = dict(kwargs) # do not modify in-place, modify copy instead
base_params = {
@@ -2354,7 +2329,6 @@ class MailThread(models.AbstractModel):
return link
- @api.multi
def _notify_get_groups(self):
""" Return groups used to classify recipients of a notification email.
Groups is a list of tuple containing of form (group_name, group_func,
@@ -2394,7 +2368,6 @@ class MailThread(models.AbstractModel):
)
]
- @api.multi
def _notify_classify_recipients(self, recipient_data, model_name):
""" Classify recipients to be notified of a message in groups to have
specific rendering depending on their group. For example users could
@@ -2459,7 +2432,6 @@ class MailThread(models.AbstractModel):
return result
- @api.multi
def _notify_get_reply_to(self, default=None, records=None, company=None, doc_names=None):
""" Returns the preferred reply-to email address when replying to a thread
on documents. Documents are either given by self it this method is called
@@ -2544,7 +2516,6 @@ class MailThread(models.AbstractModel):
return records._notify_get_reply_to(default=default, company=company, doc_names=doc_names)
return self._notify_get_reply_to(default=default, records=records, company=company, doc_names=doc_names)
- @api.multi
def _notify_email_recipient_values(self, recipient_ids):
""" Format email notification recipient values to store on the notification
mail.mail. Basic method just set the recipient partners as mail_mail
@@ -2561,7 +2532,6 @@ class MailThread(models.AbstractModel):
# Followers API
# ------------------------------------------------------
- @api.multi
def message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None):
""" Main public API to add followers to a record set. Its main purpose is
to perform access rights checks before calling ``_message_subscribe``. """
@@ -2618,7 +2588,6 @@ class MailThread(models.AbstractModel):
return True
- @api.multi
def message_unsubscribe(self, partner_ids=None, channel_ids=None):
""" Remove partners from the records followers. """
# not necessary for computation, but saves an access right check
@@ -2673,7 +2642,6 @@ class MailThread(models.AbstractModel):
pass
return []
- @api.multi
def _message_auto_subscribe_notify(self, partner_ids, template):
""" Notify new followers, using a template to render the content of the
notification message. Notifications pushed are done using the standard
@@ -2708,7 +2676,6 @@ class MailThread(models.AbstractModel):
model_description=model_description,
)
- @api.multi
def _message_auto_subscribe(self, updated_values):
""" Handle auto subscription. Auto subscription is done based on two
main mechanisms
diff --git a/addons/mail/models/mail_tracking_value.py b/addons/mail/models/mail_tracking_value.py
index e99e2fec946..499ad86f5a7 100644
--- a/addons/mail/models/mail_tracking_value.py
+++ b/addons/mail/models/mail_tracking_value.py
@@ -81,7 +81,6 @@ class MailTracking(models.Model):
return values
return {}
- @api.multi
def get_display_value(self, type):
assert type in ('new', 'old')
result = []
@@ -106,12 +105,10 @@ class MailTracking(models.Model):
result.append(record['%s_value_char' % type])
return result
- @api.multi
def get_old_display_value(self):
# grep : # old_value_integer | old_value_datetime | old_value_char
return self.get_display_value('old')
- @api.multi
def get_new_display_value(self):
# grep : # new_value_integer | new_value_datetime | new_value_char
return self.get_display_value('new')
diff --git a/addons/mail/models/models.py b/addons/mail/models/models.py
index e15bad70166..8c407ea4535 100644
--- a/addons/mail/models/models.py
+++ b/addons/mail/models/models.py
@@ -18,7 +18,6 @@ class BaseModel(models.AbstractModel):
templates = E.templates(activity_box)
return E.activity(templates, string=self._description)
- @api.multi
def _notify_email_headers(self):
"""
Generate the email headers based on record
diff --git a/addons/mail/models/res_company.py b/addons/mail/models/res_company.py
index 45011902e83..e1223bf3192 100644
--- a/addons/mail/models/res_company.py
+++ b/addons/mail/models/res_company.py
@@ -10,7 +10,6 @@ class Company(models.Model):
catchall = fields.Char(string="Catchall Email", compute="_compute_catchall")
- @api.multi
def _compute_catchall(self):
ConfigParameter = self.env['ir.config_parameter'].sudo()
alias = ConfigParameter.get_param('mail.catchall.alias')
diff --git a/addons/mail/models/res_partner.py b/addons/mail/models/res_partner.py
index e2abaf7d75b..ab32936b79c 100644
--- a/addons/mail/models/res_partner.py
+++ b/addons/mail/models/res_partner.py
@@ -22,14 +22,12 @@ class Partner(models.Model):
# override the field to track the visibility of user
user_id = fields.Many2one(tracking=True)
- @api.multi
def _message_get_suggested_recipients(self):
recipients = super(Partner, self)._message_get_suggested_recipients()
for partner in self:
partner._message_add_suggested_recipient(recipients, partner=partner, reason=_('Partner Profile'))
return recipients
- @api.multi
def _message_get_default_recipients(self):
return {r.id: {
'partner_ids': [r.id],
diff --git a/addons/mail/models/res_users.py b/addons/mail/models/res_users.py
index c7c21420585..07be8de63ee 100644
--- a/addons/mail/models/res_users.py
+++ b/addons/mail/models/res_users.py
@@ -41,7 +41,6 @@ class Users(models.Model):
out_of_office_message = fields.Char(string='Message')
@api.depends('moderation_channel_ids.moderation', 'moderation_channel_ids.moderator_ids')
- @api.multi
def _compute_is_moderator(self):
moderated = self.env['mail.channel'].search([
('id', 'in', self.mapped('moderation_channel_ids').ids),
@@ -52,7 +51,6 @@ class Users(models.Model):
for user in self:
user.is_moderator = user in user_ids
- @api.multi
def _compute_moderation_counter(self):
self._cr.execute("""
SELECT channel_moderator.res_users_id, COUNT(msg.id)
@@ -93,7 +91,6 @@ GROUP BY channel_moderator.res_users_id""", [tuple(self.ids)])
self.env['mail.channel'].search([('group_ids', 'in', user.groups_id.ids)])._subscribe_users()
return user
- @api.multi
def write(self, vals):
write_res = super(Users, self).write(vals)
sel_groups = [vals[k] for k in vals if is_selection_groups(k) and vals[k]]
@@ -159,7 +156,6 @@ class res_groups_mail_channel(models.Model):
_inherit = 'res.groups'
_description = 'Access Groups'
- @api.multi
def write(self, vals, context=None):
write_res = super(res_groups_mail_channel, self).write(vals)
if vals.get('users'):
diff --git a/addons/mail/models/update.py b/addons/mail/models/update.py
index 54cbc98ffef..5f3a1d70c40 100644
--- a/addons/mail/models/update.py
+++ b/addons/mail/models/update.py
@@ -79,7 +79,6 @@ class PublisherWarrantyContract(AbstractModel):
r.raise_for_status()
return literal_eval(r.text)
- @api.multi
def update_notification(self, cron_mode=True):
"""
Send a message to Odoo's publisher warranty server to check the
diff --git a/addons/mail/wizard/base_partner_merge.py b/addons/mail/wizard/base_partner_merge.py
index d31749cacad..aed2cefd723 100644
--- a/addons/mail/wizard/base_partner_merge.py
+++ b/addons/mail/wizard/base_partner_merge.py
@@ -7,7 +7,6 @@ class MergePartnerAutomatic(models.TransientModel):
_inherit = 'base.partner.merge.automatic.wizard'
- @api.multi
def _log_merge_operation(self, src_partners, dst_partner):
super(MergePartnerAutomatic, self)._log_merge_operation(src_partners, dst_partner)
dst_partner.message_post(body='%s %s' % (_("Merged with the following partners:"), ", ".join('%s <%s> (ID %s)' % (p.name, p.email or 'n/a', p.id) for p in src_partners)))
diff --git a/addons/mail/wizard/email_template_preview.py b/addons/mail/wizard/email_template_preview.py
index 95b9f9208c5..244cdb295bc 100644
--- a/addons/mail/wizard/email_template_preview.py
+++ b/addons/mail/wizard/email_template_preview.py
@@ -45,7 +45,6 @@ class TemplatePreview(models.TransientModel):
preview_lang = fields.Selection(_get_languages, string='Template Preview Language')
@api.onchange('res_id', 'preview_lang')
- @api.multi
def on_change_res_id(self):
if not self.res_id:
return {}
diff --git a/addons/mail/wizard/invite.py b/addons/mail/wizard/invite.py
index 5c7889b6a76..34f42159cd4 100644
--- a/addons/mail/wizard/invite.py
+++ b/addons/mail/wizard/invite.py
@@ -46,7 +46,6 @@ class Invite(models.TransientModel):
message = fields.Html('Message')
send_mail = fields.Boolean('Send Email', default=True, help="If checked, the partners will receive an email warning they have been added in the document's followers.")
- @api.multi
def add_followers(self):
email_from = self.env['mail.message']._get_default_from()
for wizard in self:
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py
index 55cd6740b4b..ac05a1cf2a0 100644
--- a/addons/mail/wizard/mail_compose_message.py
+++ b/addons/mail/wizard/mail_compose_message.py
@@ -204,13 +204,11 @@ class MailComposer(models.TransientModel):
#------------------------------------------------------
# action buttons call with positionnal arguments only, so we need an intermediary function
# to ensure the context is passed correctly
- @api.multi
def action_send_mail(self):
self.send_mail()
return {'type': 'ir.actions.act_window_close', 'infos': 'mail_sent'}
- @api.multi
def send_mail(self, auto_commit=False):
""" Process the wizard content and proceed with sending the related
email(s), rendering any template patterns on the fly if needed. """
@@ -289,7 +287,6 @@ class MailComposer(models.TransientModel):
if wizard.composition_mode == 'mass_mail':
batch_mails.send(auto_commit=auto_commit)
- @api.multi
def get_mail_values(self, res_ids):
"""Generate the values that will be used by send_mail to create mail_messages
or mail_mails. """
@@ -380,7 +377,6 @@ class MailComposer(models.TransientModel):
# Template methods
#------------------------------------------------------
- @api.multi
@api.onchange('template_id')
def onchange_template_id_wrapper(self):
self.ensure_one()
@@ -388,7 +384,6 @@ class MailComposer(models.TransientModel):
for fname, value in values.items():
setattr(self, fname, value)
- @api.multi
def onchange_template_id(self, template_id, composition_mode, model, res_id):
""" - mass_mailing: we cannot render, so return the template values
- normal mode: return rendered values
@@ -434,7 +429,6 @@ class MailComposer(models.TransientModel):
return {'value': values}
- @api.multi
def save_as_template(self):
""" hit save as template button: current form value will be a new
template attached to the current document. """
@@ -459,7 +453,6 @@ class MailComposer(models.TransientModel):
# Template rendering
#------------------------------------------------------
- @api.multi
def render_message(self, res_ids):
"""Generate template-based values of wizard, for the document records given
by res_ids. This method is meant to be inherited by email_template that
diff --git a/addons/mail/wizard/mail_resend_cancel.py b/addons/mail/wizard/mail_resend_cancel.py
index f3bb8307754..7f2c5d334fb 100644
--- a/addons/mail/wizard/mail_resend_cancel.py
+++ b/addons/mail/wizard/mail_resend_cancel.py
@@ -11,13 +11,11 @@ class MailResendCancel(models.TransientModel):
model = fields.Char(string='Model')
help_message = fields.Char(string='Help message', compute='_compute_help_message')
- @api.multi
@api.depends('model')
def _compute_help_message(self):
for wizard in self:
wizard.help_message = _("Are you sure you want to discard %s mail delivery failures. You won't be able to re-send these mails later!") % (wizard._context.get('unread_counter'))
- @api.multi
def cancel_resend_action(self):
author_id = self.env.user.partner_id.id
for wizard in self:
diff --git a/addons/mail/wizard/mail_resend_message.py b/addons/mail/wizard/mail_resend_message.py
index 9c72944961b..dc659681dac 100644
--- a/addons/mail/wizard/mail_resend_message.py
+++ b/addons/mail/wizard/mail_resend_message.py
@@ -49,7 +49,6 @@ class MailResendMessage(models.TransientModel):
raise UserError('No message_id found in context')
return rec
- @api.multi
def resend_mail_action(self):
""" Process the wizard content and proceed with sending the related
email(s), rendering any template patterns on the fly if needed. """
@@ -79,7 +78,6 @@ class MailResendMessage(models.TransientModel):
self.mail_message_id._notify_mail_failure_update()
return {'type': 'ir.actions.act_window_close'}
- @api.multi
def cancel_mail_action(self):
for wizard in self:
for notif in wizard.notification_ids: