From 64c28607b543b6a4ee29dcd7627787eb5b34e06f Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Thu, 17 Oct 2019 09:33:56 +0000 Subject: [PATCH 1/2] :shield: travis: bump python version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0fccba0..430e5d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python python: - - "3.5" + - "3.6" #dist: trusty sudo: false From 1502eabee3c23f8d4b74ca50496136ffbad3efc0 Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Thu, 17 Oct 2019 10:07:23 +0000 Subject: [PATCH 2/2] :arrow_up::one::three: Take away deprecated api.multi decorator --- mail_base/models.py | 2 -- mail_move_message/mail_move_message_models.py | 20 ------------------- mail_multi_website/models/ir_property.py | 1 - mail_multi_website/models/mail_template.py | 2 -- mail_multi_website/models/res_users.py | 1 - mail_private/models.py | 2 -- mail_sent/models.py | 1 - res_partner_company_messages/models.py | 1 - res_partner_mails_count/models.py | 2 -- 9 files changed, 32 deletions(-) diff --git a/mail_base/models.py b/mail_base/models.py index 9bdf491..2c44fe2 100644 --- a/mail_base/models.py +++ b/mail_base/models.py @@ -5,7 +5,6 @@ from openerp import api, models class MailMessage(models.Model): _inherit = 'mail.message' - @api.multi def write(self, values): if values.get('needaction_partner_ids'): if not values.get('partner_ids'): @@ -21,7 +20,6 @@ class MailComposer(models.TransientModel): _inherit = 'mail.compose.message' - @api.multi def send_mail(self, auto_commit=False): res = super(MailComposer, self).send_mail(auto_commit=auto_commit) notification = {} diff --git a/mail_move_message/mail_move_message_models.py b/mail_move_message/mail_move_message_models.py index 2a0601f..5988d27 100644 --- a/mail_move_message/mail_move_message_models.py +++ b/mail_move_message/mail_move_message_models.py @@ -96,7 +96,6 @@ class Wizard(models.TransientModel): "You must use this option, if new record has restricted access.\n" "You can change default value for this option at Settings/System Parameters") - @api.multi @api.depends('model_record') def _compute_model_res_id(self): for rec in self: @@ -104,17 +103,14 @@ class Wizard(models.TransientModel): rec.res_id = rec.model_record and rec.model_record.id or False @api.depends('message_id') - @api.multi def _compute_get_can_move(self): for r in self: r.get_can_move_one() - @api.multi def _compute_is_read(self): messages = self.env['mail.message'].sudo().browse(self.message_id.all_child_ids.ids + [self.message_id.id]) self.message_to_read = True in [m.needaction for m in messages] - @api.multi def get_can_move_one(self): self.ensure_one() # message was not moved before OR message is a top message of previous move @@ -164,12 +160,10 @@ class Wizard(models.TransientModel): self.res_id = None return {'domain': domain} - @api.multi def check_access(self): for r in self: r.check_access_one() - @api.multi def check_access_one(self): self.ensure_one() operation = 'write' @@ -183,7 +177,6 @@ class Wizard(models.TransientModel): else: self.env['mail.thread'].check_mail_message_access(mids.ids, operation, model_name=self.model) - @api.multi def open_moved_by_message_id(self): message_id = None for r in self: @@ -198,7 +191,6 @@ class Wizard(models.TransientModel): 'context': {'default_message_id': message_id}, } - @api.multi def move(self): for r in self: if not r.model: @@ -229,12 +221,10 @@ class Wizard(models.TransientModel): 'type': 'ir.actions.act_window', } - @api.multi def delete(self): for r in self: r.delete_one() - @api.multi def delete_one(self): self.ensure_one() msg_id = self.message_id.id @@ -246,12 +236,10 @@ class Wizard(models.TransientModel): self.message_id.unlink() return {} - @api.multi def read_close(self): for r in self: r.read_close_one() - @api.multi def read_close_one(self): self.ensure_one() self.message_id.set_message_done() @@ -271,12 +259,10 @@ class MailMessage(models.Model): all_child_ids = fields.One2many('mail.message', string='All childs', compute='_compute_get_all_childs', help='all childs, including subchilds') moved_as_unread = fields.Boolean('Was Unread', default=False) - @api.multi def _compute_get_all_childs(self, include_myself=True): for r in self: r._get_all_childs_one(include_myself=include_myself) - @api.multi def _get_all_childs_one(self, include_myself=True): self.ensure_one() ids = [] @@ -291,7 +277,6 @@ class MailMessage(models.Model): moved_childs = self.search([('moved_by_message_id', '=', self.id)]).ids self.all_child_ids = ids + moved_childs - @api.multi def move_followers(self, model, ids): fol_obj = self.env['mail.followers'] for message in self: @@ -300,12 +285,10 @@ class MailMessage(models.Model): for f in followers: self.env[model].browse(ids).message_subscribe([f.partner_id.id], [s.id for s in f.subtype_ids]) - @api.multi def move(self, parent_id, res_id, model, move_back, move_followers=False, message_to_read=False, author=False): for r in self: r.move_one(parent_id, res_id, model, move_back, move_followers=move_followers, message_to_read=message_to_read, author=author) - @api.multi def move_one(self, parent_id, res_id, model, move_back, move_followers=False, message_to_read=False, author=False): self.ensure_one() if parent_id == self.id: @@ -384,7 +367,6 @@ class MailMessage(models.Model): } self.env['bus.bus'].sendone((self._cr.dbname, 'mail_move_message'), notification) - @api.multi def name_get(self): context = self.env.context if not (context or {}).get('extended_name'): @@ -397,7 +379,6 @@ class MailMessage(models.Model): res.append((record['id'], name + extended_name)) return res - @api.multi def message_format(self): message_values = super(MailMessage, self).message_format() message_index = {message['id']: message for message in message_values} @@ -427,7 +408,6 @@ class MailMoveMessageConfiguration(models.TransientModel): ) return res - @api.multi def set_values(self): super(MailMoveMessageConfiguration, self).set_values() config_parameters = self.env["ir.config_parameter"].sudo() diff --git a/mail_multi_website/models/ir_property.py b/mail_multi_website/models/ir_property.py index 64c601d..d09520c 100644 --- a/mail_multi_website/models/ir_property.py +++ b/mail_multi_website/models/ir_property.py @@ -7,7 +7,6 @@ from odoo import models, api class IrProperty(models.Model): _inherit = 'ir.property' - @api.multi def write(self, vals): res = super(IrProperty, self).write(vals) field_object_list = [ diff --git a/mail_multi_website/models/mail_template.py b/mail_multi_website/models/mail_template.py index 0e48bfe..29a3b3e 100644 --- a/mail_multi_website/models/mail_template.py +++ b/mail_multi_website/models/mail_template.py @@ -24,7 +24,6 @@ class MailTemplate(models.Model): mail_server_id = fields.Many2one(string='Outgoing Mail Server (Multi-Website)', company_dependent=True, website_dependent=True) report_template = fields.Many2one(string='Optional report to print and attach (Multi-Website)', company_dependent=True, website_dependent=True) - @api.multi def generate_email(self, res_ids, fields=None): """Remove mail_server_id when not set to recompute in _default_mail_server_id in mail.message""" multi_mode = True @@ -128,7 +127,6 @@ class MailTemplate(models.Model): res._force_default(f, vals.get(f)) return res - @api.multi def write(self, vals): res = super(MailTemplate, self).write(vals) diff --git a/mail_multi_website/models/res_users.py b/mail_multi_website/models/res_users.py index 8d8762d..cc8e3d9 100644 --- a/mail_multi_website/models/res_users.py +++ b/mail_multi_website/models/res_users.py @@ -30,7 +30,6 @@ class User(models.Model): res._force_default(f, vals.get(f)) return res - @api.multi def write(self, vals): res = super(User, self).write(vals) # TODO: will it work with OCA's partner_firstname module? diff --git a/mail_private/models.py b/mail_private/models.py index 70b9c87..195b8d6 100644 --- a/mail_private/models.py +++ b/mail_private/models.py @@ -46,7 +46,6 @@ class MailMessage(models.Model): # }) return result - @api.multi def _notify(self, record, msg_vals, force_send=False, send_after_commit=True, model_description=False, mail_auto_delete=True): self_sudo = self.sudo() msg_vals = msg_vals if msg_vals else {} @@ -56,7 +55,6 @@ class MailMessage(models.Model): rdata = self._notify_compute_internal_recipients(record, msg_vals) return self._notify_recipients(rdata, record, msg_vals, force_send, send_after_commit, model_description, mail_auto_delete) - @api.multi def _notify_compute_internal_recipients(self, record, msg_vals): recipient_data = super(MailMessage, self)._notify_compute_recipients(record, msg_vals) pids = [x[1] for x in msg_vals.get('partner_ids')] if 'partner_ids' in msg_vals else self.sudo().partner_ids.ids diff --git a/mail_sent/models.py b/mail_sent/models.py index a9f6830..af06e05 100644 --- a/mail_sent/models.py +++ b/mail_sent/models.py @@ -29,7 +29,6 @@ class MailMessage(models.Model): ) r.sent = sent - @api.multi def message_format(self): message_values = super(MailMessage, self).message_format() message_index = {message['id']: message for message in message_values} diff --git a/res_partner_company_messages/models.py b/res_partner_company_messages/models.py index 6898fe1..bad129d 100644 --- a/res_partner_company_messages/models.py +++ b/res_partner_company_messages/models.py @@ -5,7 +5,6 @@ from openerp import models class Partner(models.Model): _inherit = 'res.partner' - @api.multi def read(self, fields=None, load='_classic_read'): res = super(Partner, self).read(fields=fields, load=load) if fields and 'message_ids' in fields: diff --git a/res_partner_mails_count/models.py b/res_partner_mails_count/models.py index cb59139..76e86fb 100644 --- a/res_partner_mails_count/models.py +++ b/res_partner_mails_count/models.py @@ -7,12 +7,10 @@ class ResPartner(models.Model): mails_to = fields.Integer(compute="_compute_mails_to") mails_from = fields.Integer(compute="_compute_mails_from") - @api.multi def _compute_mails_to(self): for r in self: r.mails_to = self.env['mail.message'].sudo().search_count([('partner_ids', 'in', r.id)]) - @api.multi def _compute_mails_from(self): for r in self: r.mails_from = self.env['mail.message'].sudo().search_count([('author_id', '=', r.id)])