diff options
| author | Adrian Torres <adt@odoo.com> | 2019-07-10 14:59:37 +0200 |
|---|---|---|
| committer | Adrian Torres <adt@odoo.com> | 2019-07-17 14:13:12 +0200 |
| commit | 4b38cc6590abcb58a0ca102a06063eb3db7ac1f4 (patch) | |
| tree | cfd11739fc6b4c0cb4b23b54cc6badad4bf5c55e /addons/sms/models | |
| parent | f6fdde96bddfedf8764cd8a73089e44340d476ae (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/sms/models')
| -rw-r--r-- | addons/sms/models/mail_message.py | 5 | ||||
| -rw-r--r-- | addons/sms/models/mail_thread.py | 3 | ||||
| -rw-r--r-- | addons/sms/models/sms_sms.py | 3 | ||||
| -rw-r--r-- | addons/sms/models/sms_template.py | 3 |
4 files changed, 0 insertions, 14 deletions
diff --git a/addons/sms/models/mail_message.py b/addons/sms/models/mail_message.py index 92fda5e8a83..9e79500e9c0 100644 --- a/addons/sms/models/mail_message.py +++ b/addons/sms/models/mail_message.py @@ -19,7 +19,6 @@ class MailMessage(models.Model): 'Has SMS error', compute='_compute_has_sms_error', search='_search_has_sms_error', help='Has error') - @api.multi def _compute_has_sms_error(self): sms_error_from_notification = self.env['mail.notification'].sudo().search([ ('notification_type', '=', 'sms'), @@ -28,13 +27,11 @@ class MailMessage(models.Model): for message in self: message.has_error = message in sms_error_from_notification - @api.multi def _search_has_sms_error(self, operator, operand): if operator == '=' and operand: return ['&', ('notification_ids.notification_status', '=', 'exception'), ('notification_ids.notification_type', '=', True)] raise NotImplementedError() - @api.multi def _format_mail_failures(self): """ A shorter message to notify a SMS delivery failure update @@ -62,7 +59,6 @@ class MailMessage(models.Model): res.append(info) return res - @api.multi def _notify_sms_update(self): """ Send bus notifications to update status of notifications in chatter. Purpose is to send the updated status per author. @@ -88,7 +84,6 @@ class MailMessage(models.Model): ] for author, author_messages in groupby(messages, itemgetter('author_id'))] self.env['bus.bus'].sendmany(updates) - @api.multi def message_format(self): """ Override in order to retrieves data about SMS (recipient name and SMS status) diff --git a/addons/sms/models/mail_thread.py b/addons/sms/models/mail_thread.py index a432d29a2d3..467a60127cd 100644 --- a/addons/sms/models/mail_thread.py +++ b/addons/sms/models/mail_thread.py @@ -17,7 +17,6 @@ class MailThread(models.AbstractModel): 'SMS Delivery error', compute='_compute_message_has_sms_error', search='_search_message_has_sms_error', help="If checked, some messages have a delivery error.") - @api.multi def _compute_message_has_sms_error(self): res = {} if self.ids: @@ -185,13 +184,11 @@ class MailThread(models.AbstractModel): **kwargs ) - @api.multi def _notify_thread(self, message, msg_vals=False, **kwargs): recipients_data = super(MailThread, self)._notify_thread(message, msg_vals=msg_vals, **kwargs) self._notify_record_by_sms(message, recipients_data, msg_vals=msg_vals, **kwargs) return recipients_data - @api.multi def _notify_record_by_sms(self, message, recipients_data, msg_vals=False, sms_numbers=None, sms_pid_to_number=None, check_existing=False, put_in_queue=False, **kwargs): diff --git a/addons/sms/models/sms_sms.py b/addons/sms/models/sms_sms.py index 699f4efa5f5..98120662b04 100644 --- a/addons/sms/models/sms_sms.py +++ b/addons/sms/models/sms_sms.py @@ -31,7 +31,6 @@ class SmsSms(models.Model): ('sms_server', 'Server Error') ]) - @api.multi def send(self, delete_all=False, auto_commit=False, raise_exception=False): """ Main API method to send SMS. @@ -76,7 +75,6 @@ class SmsSms(models.Model): for sms_batch in tools.split_every(batch_size, self.ids): yield sms_batch - @api.multi def _send(self, delete_all=False, raise_exception=False): """ This method tries to send SMS after checking the number (presence and formatting). """ @@ -129,7 +127,6 @@ class SmsSms(models.Model): if todelete_sms_ids: self.browse(todelete_sms_ids).sudo().unlink() - @api.multi def cancel(self): self.write({ 'state': 'canceled', diff --git a/addons/sms/models/sms_template.py b/addons/sms/models/sms_template.py index 6835bac7eb6..636e40bb534 100644 --- a/addons/sms/models/sms_template.py +++ b/addons/sms/models/sms_template.py @@ -80,14 +80,12 @@ class SMSTemplate(models.Model): expression += "}" return expression - @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(SMSTemplate, self).copy(default=default) - @api.multi def _get_context_lang_per_id(self, res_ids): self.ensure_one() if res_ids is None: @@ -104,7 +102,6 @@ class SMSTemplate(models.Model): return results - @api.multi def _get_ids_per_lang(self, res_ids): self.ensure_one() |
