From 0eb2406427dee4d2999f99b91b974a86fda3af0f Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Sat, 16 Feb 2019 13:01:02 -0500 Subject: [PATCH 1/3] :ambulance: polling error on database concurrency error For explanation see https://github.com/odoo/odoo/commit/d7b7b07f9e9ead98d6ecc3e5ce3dca4d4a4a2b6f --- mail_base/__manifest__.py | 2 +- mail_base/controllers/main.py | 1 + mail_base/doc/changelog.rst | 4 ++++ mail_move_message/__manifest__.py | 2 +- mail_move_message/controllers/main.py | 1 + mail_move_message/doc/changelog.rst | 4 ++++ 6 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mail_base/__manifest__.py b/mail_base/__manifest__.py index 434e370a..3ce27deb 100644 --- a/mail_base/__manifest__.py +++ b/mail_base/__manifest__.py @@ -4,7 +4,7 @@ "summary": """Makes Mail extendable""", "category": "Discuss", "images": [], - "version": "1.0.4", + "version": "1.0.5", "author": "IT-Projects LLC, Pavel Romanchenko", "support": "apps@it-projects.info", diff --git a/mail_base/controllers/main.py b/mail_base/controllers/main.py index 06f86954..8463aed3 100644 --- a/mail_base/controllers/main.py +++ b/mail_base/controllers/main.py @@ -10,6 +10,7 @@ class MailChatController(BusController): def _poll(self, dbname, channels, last, options): if request.session.uid: + channels = list(channels) # do not alter original list channels.append((request.db, 'mail_base.mail_sent')) return super(MailChatController, self)._poll(dbname, channels, last, options) diff --git a/mail_base/doc/changelog.rst b/mail_base/doc/changelog.rst index dd41f409..d1474d81 100644 --- a/mail_base/doc/changelog.rst +++ b/mail_base/doc/changelog.rst @@ -1,3 +1,7 @@ +`1.0.5` +------- +**FIX**: polling errors on heavy server load + `1.0.4` ------- **FIX**: issue related to clear cache diff --git a/mail_move_message/__manifest__.py b/mail_move_message/__manifest__.py index 438a563f..103e46b7 100644 --- a/mail_move_message/__manifest__.py +++ b/mail_move_message/__manifest__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- { 'name': 'Mail relocation', - 'version': '1.0.5', + 'version': '1.0.6', 'author': 'IT-Projects LLC, Ivan Yelizariev, Pavel Romanchenko', 'license': 'LGPL-3', 'category': 'Discuss', diff --git a/mail_move_message/controllers/main.py b/mail_move_message/controllers/main.py index bb51fc80..8d1aa9fe 100644 --- a/mail_move_message/controllers/main.py +++ b/mail_move_message/controllers/main.py @@ -13,6 +13,7 @@ class MailChatController(BusController): def _poll(self, dbname, channels, last, options): if request.session.uid: + channels = list(channels) # do not alter original list channels.append((request.db, 'mail_move_message')) channels.append((request.db, 'mail_move_message.delete_message')) return super(MailChatController, self)._poll(dbname, channels, last, options) diff --git a/mail_move_message/doc/changelog.rst b/mail_move_message/doc/changelog.rst index 2021f90f..d6f593d9 100644 --- a/mail_move_message/doc/changelog.rst +++ b/mail_move_message/doc/changelog.rst @@ -1,3 +1,7 @@ +`1.0.6` +------- +**FIX**: polling errors on heavy server load + `1.0.5` ------- From 20435618587ed0427d814a96d71d0567c7cf8647 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Sat, 16 Feb 2019 13:17:48 -0500 Subject: [PATCH 2/3] :green_heart: --- mail_base/__manifest__.py | 2 +- mail_move_message/__manifest__.py | 2 +- mail_move_message/doc/index.rst | 4 ++++ mail_move_message/mail_move_message_models.py | 13 ++++--------- 4 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 mail_move_message/doc/index.rst diff --git a/mail_base/__manifest__.py b/mail_base/__manifest__.py index 3ce27deb..adf46b68 100644 --- a/mail_base/__manifest__.py +++ b/mail_base/__manifest__.py @@ -4,7 +4,7 @@ "summary": """Makes Mail extendable""", "category": "Discuss", "images": [], - "version": "1.0.5", + "version": "10.0.1.0.5", "author": "IT-Projects LLC, Pavel Romanchenko", "support": "apps@it-projects.info", diff --git a/mail_move_message/__manifest__.py b/mail_move_message/__manifest__.py index 103e46b7..1403ecbf 100644 --- a/mail_move_message/__manifest__.py +++ b/mail_move_message/__manifest__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- { 'name': 'Mail relocation', - 'version': '1.0.6', + 'version': '10.0.1.0.6', 'author': 'IT-Projects LLC, Ivan Yelizariev, Pavel Romanchenko', 'license': 'LGPL-3', 'category': 'Discuss', diff --git a/mail_move_message/doc/index.rst b/mail_move_message/doc/index.rst new file mode 100644 index 00000000..9249be63 --- /dev/null +++ b/mail_move_message/doc/index.rst @@ -0,0 +1,4 @@ +================= + Mail relocation +================= + diff --git a/mail_move_message/mail_move_message_models.py b/mail_move_message/mail_move_message_models.py index 6732e831..3cdbd114 100644 --- a/mail_move_message/mail_move_message_models.py +++ b/mail_move_message/mail_move_message_models.py @@ -71,7 +71,7 @@ def default_get(self, fields_list): parent_id = fields.Many2one('mail.message', string='Search by name', ) model = fields.Selection(_model_selection, string='Model') res_id = fields.Integer(string='Record') - can_move = fields.Boolean('Can move', compute='get_can_move') + can_move = fields.Boolean('Can move', compute='_compute_can_move') move_back = fields.Boolean('MOVE TO ORIGIN', help='Move message and submessages to original place') partner_id = fields.Many2one('res.partner', string='Author') filter_by_partner = fields.Boolean('Filter Records by partner') @@ -88,15 +88,10 @@ def default_get(self, fields_list): @api.depends('message_id') @api.multi - def get_can_move(self): + def _compute_can_move(self): for r in self: - r.get_can_move_one() - - @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 - self.can_move = not self.message_id.moved_by_message_id or self.message_id.moved_by_message_id.id == self.message_id.id + # message was not moved before OR message is a top message of previous move + r.can_move = not r.message_id.moved_by_message_id or r.message_id.moved_by_message_id.id == r.message_id.id @api.onchange('move_back') def on_change_move_back(self): From 07a9248b9c64abc9104e209b4156480e79d237a3 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Sat, 16 Feb 2019 13:47:16 -0500 Subject: [PATCH 3/3] :green_heart: --- mail_move_message/mail_move_message_models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mail_move_message/mail_move_message_models.py b/mail_move_message/mail_move_message_models.py index 3cdbd114..b2c154ba 100644 --- a/mail_move_message/mail_move_message_models.py +++ b/mail_move_message/mail_move_message_models.py @@ -264,15 +264,15 @@ class MailMessage(models.Model): moved_from_parent_id = fields.Many2one('mail.message', 'Parent Message (Original)', ondelete='set null') moved_by_message_id = fields.Many2one('mail.message', 'Moved by message', ondelete='set null', help='Top message, that initate moving this message') moved_by_user_id = fields.Many2one('res.users', 'Moved by user', ondelete='set null') - all_child_ids = fields.One2many('mail.message', string='All childs', compute='_get_all_childs', help='all childs, including subchilds') + all_child_ids = fields.One2many('mail.message', string='All childs', compute='_compute_all_childs', help='all childs, including subchilds') @api.multi - def _get_all_childs(self, include_myself=True): + def _compute_all_childs(self, include_myself=True): for r in self: - r._get_all_childs_one(include_myself=include_myself) + r._compute_all_childs_one(include_myself=include_myself) @api.multi - def _get_all_childs_one(self, include_myself=True): + def _compute_all_childs_one(self, include_myself=True): self.ensure_one() ids = [] if include_myself: