From 4e43be1951cf7b69d93f1e4f4d4620ad02671494 Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Tue, 18 Feb 2020 13:07:23 +0500 Subject: [PATCH 1/9] :rainbow: pre-commit: disable manifest-version-format --- mail_fix_553/__manifest__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mail_fix_553/__manifest__.py b/mail_fix_553/__manifest__.py index e6529c2..5639f3c 100644 --- a/mail_fix_553/__manifest__.py +++ b/mail_fix_553/__manifest__.py @@ -1,3 +1,4 @@ +# pylint: disable=manifest-version-format { "name": "Fix mail error 553", "version": "0.3", From b165d5f615d3df98a5c623a5a8a21c0d23ff8fac Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Tue, 18 Feb 2020 13:15:29 +0500 Subject: [PATCH 2/9] :rainbow: pre-commit: redefined built-in --- mail_fix_553/mail_fix_553.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mail_fix_553/mail_fix_553.py b/mail_fix_553/mail_fix_553.py index 890f29d..0be46b3 100644 --- a/mail_fix_553/mail_fix_553.py +++ b/mail_fix_553/mail_fix_553.py @@ -5,7 +5,7 @@ from email.utils import formataddr from odoo import SUPERUSER_ID, tools from odoo.osv import osv -from odoo.tools.safe_eval import safe_eval as eval +from odoo.tools.safe_eval import safe_eval from odoo.tools.translate import _ from odoo.addons.base.ir.ir_mail_server import MailDeliveryException @@ -115,7 +115,7 @@ class MailMail(osv.Model): ) if mail.headers: try: - headers.update(eval(mail.headers)) + headers.update(safe_eval(mail.headers)) except Exception: pass From e4daacf3ff5484af409954e32c6d825fb5689d11 Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Tue, 18 Feb 2020 13:19:09 +0500 Subject: [PATCH 3/9] :rainbow: pre-commit: disable pylint --- mail_fix_553/mail_fix_553.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mail_fix_553/mail_fix_553.py b/mail_fix_553/mail_fix_553.py index 0be46b3..b69c96d 100644 --- a/mail_fix_553/mail_fix_553.py +++ b/mail_fix_553/mail_fix_553.py @@ -1,3 +1,4 @@ +# pylint: disable=old-api7-method-defined,invalid-commit import base64 import logging import re From fe1b23a6df099a6fa5e42cd63ac1daf8818ff691 Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Tue, 18 Feb 2020 14:16:58 +0500 Subject: [PATCH 4/9] :rainbow: pre-commit: no-unused-vars --- mail_move_message/static/src/js/mail_move_message.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/mail_move_message/static/src/js/mail_move_message.js b/mail_move_message/static/src/js/mail_move_message.js index 0a8e580..98f799c 100644 --- a/mail_move_message/static/src/js/mail_move_message.js +++ b/mail_move_message/static/src/js/mail_move_message.js @@ -7,25 +7,13 @@ odoo.define("mail_move_message.relocate", function(require) { "use strict"; - var bus = require("bus.bus").bus; var chat_manager = require("mail_base.base").chat_manager; var thread = require("mail.ChatThread"); var chatter = require("mail.Chatter"); - var rpc = require("web.rpc"); var Basicmodel = require("web.BasicModel"); - var view_dialogs = require("web.view_dialogs"); - var field_utils_format = require("web.field_utils").format; - var BasicRenderer = require("web.BasicRenderer"); var core = require("web.core"); - var form_widget = require("web.FormRenderer"); - var session = require("web.Session"); var FormController = require("web.FormController"); - var FormView = require("web.FormView"); - var FormRenderer = require("web.FormRenderer"); - var dialogs = require("web.view_dialogs"); - var Dialog = require("web.Dialog"); var relational_fields = require("web.relational_fields"); - var Widget = require("web.Widget"); var _t = core._t; From 90ec04e531512f65e5f019302bd6d3a0999b2f10 Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Tue, 18 Feb 2020 14:28:19 +0500 Subject: [PATCH 5/9] :rainbow: pre-commit: no-negated-condition --- mail_private/static/src/js/mail_private.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mail_private/static/src/js/mail_private.js b/mail_private/static/src/js/mail_private.js index 951c293..9d3d2f1 100644 --- a/mail_private/static/src/js/mail_private.js +++ b/mail_private/static/src/js/mail_private.js @@ -7,7 +7,6 @@ odoo.define("mail_private", function(require) { "use strict"; - var core = require("web.core"); var Chatter = require("mail.Chatter"); var ChatterComposer = require("mail.ChatterComposer"); var chat_manager = require("mail_base.base").chat_manager; @@ -174,7 +173,9 @@ odoo.define("mail_private", function(require) { } // Partner_ids - if (!self.options.is_log) { + if (self.options.is_log) { + def.resolve(message); + } else { var checked_suggested_partners = self.get_checked_suggested_partners(); self.check_suggested_partners(checked_suggested_partners).done( function(partner_ids) { @@ -188,8 +189,6 @@ odoo.define("mail_private", function(require) { def.resolve(message); } ); - } else { - def.resolve(message); } }); return def; From d85aea4b5a1361d50c32de7b2bafb32b1167ba20 Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Tue, 18 Feb 2020 15:31:43 +0500 Subject: [PATCH 6/9] :rainbow: pre-commit: no-empty-function --- mail_move_message/static/src/js/mail_move_message.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mail_move_message/static/src/js/mail_move_message.js b/mail_move_message/static/src/js/mail_move_message.js index 98f799c..4848813 100644 --- a/mail_move_message/static/src/js/mail_move_message.js +++ b/mail_move_message/static/src/js/mail_move_message.js @@ -38,7 +38,9 @@ odoo.define("mail_move_message.relocate", function(require) { context: {default_message_id: message_id}, }; this.do_action(action, { - on_close: function() {}, + on_close: function() { + // Empty + }, }); }, }); From 2a85744705a90425b32fce1ced0fe03080043590 Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Tue, 18 Feb 2020 16:12:23 +0500 Subject: [PATCH 7/9] :rainbow: pre-commit: no-shadow --- mail_move_message/static/src/js/mail_move_message.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail_move_message/static/src/js/mail_move_message.js b/mail_move_message/static/src/js/mail_move_message.js index 4848813..b596446 100644 --- a/mail_move_message/static/src/js/mail_move_message.js +++ b/mail_move_message/static/src/js/mail_move_message.js @@ -50,7 +50,7 @@ odoo.define("mail_move_message.relocate", function(require) { var result = this._super.apply(this, arguments); // For show wizard in the form if (this.fields.thread && this.fields.thread.thread) { - var thread = this.fields.thread.thread; + thread = this.fields.thread.thread; thread.on("move_message", this, thread.on_move_message); } return $.when(result).done(function() {}); From f0a96a853b1d9c4dbc933cb267b39c599c4c17b9 Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Tue, 18 Feb 2020 16:14:34 +0500 Subject: [PATCH 8/9] :rainbow: pre-commit: no-empty-function --- mail_move_message/static/src/js/mail_move_message.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mail_move_message/static/src/js/mail_move_message.js b/mail_move_message/static/src/js/mail_move_message.js index b596446..79f38d8 100644 --- a/mail_move_message/static/src/js/mail_move_message.js +++ b/mail_move_message/static/src/js/mail_move_message.js @@ -53,7 +53,9 @@ odoo.define("mail_move_message.relocate", function(require) { thread = this.fields.thread.thread; thread.on("move_message", this, thread.on_move_message); } - return $.when(result).done(function() {}); + return $.when(result).done(function() { + // Empty + }); }, }); @@ -63,7 +65,9 @@ odoo.define("mail_move_message.relocate", function(require) { var result = this._super.apply(this, arguments); // For show wizard in the channels this.thread.on("move_message", this, this.thread.on_move_message); - return $.when(result).done(function() {}); + return $.when(result).done(function() { + // Empty + }); }, }); From 3a33f6b5b01c5fe37fa9cb0f59f50f27218a628a Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Tue, 18 Feb 2020 16:42:06 +0500 Subject: [PATCH 9/9] :rainbow: pre-commit: make TODO for ambiguous code and ignore it --- mail_move_message/static/src/js/mail_move_message.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mail_move_message/static/src/js/mail_move_message.js b/mail_move_message/static/src/js/mail_move_message.js index 79f38d8..5f320c1 100644 --- a/mail_move_message/static/src/js/mail_move_message.js +++ b/mail_move_message/static/src/js/mail_move_message.js @@ -1,3 +1,5 @@ +/* eslint no-unused-vars: "off"*/ + /* Copyright 2016 Ildar Nasyrov # Copyright 2016 Ivan Yelizariev # Copyright 2016 Pavel Romanchenko @@ -121,6 +123,7 @@ odoo.define("mail_move_message.relocate", function(require) { ) { var self = this; var field_data = event.data.record.data; + // TODO: it seems like debugging, test without this code this.on_saved = function(record, bool) { var values = [ { @@ -143,6 +146,7 @@ odoo.define("mail_move_message.relocate", function(require) { // Necessary for correct _trigger_up implementation in mixins.js return self; }; + // TODO: it seems like debugging, test without this code var wizard_popup = relField._searchCreatePopup("form", false, { message_name_from: field_data.message_name_from &&