From ef41f4a65edd4bb086a35a71325ac304c792825f Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Wed, 12 Feb 2020 06:55:01 +0000 Subject: [PATCH 01/16] :green_heart: pre-commit: auto cleanups --- .DINAR/image/README.md | 6 +- .DINAR/image/src/addons.yaml | 1 - .eslintrc.yml | 2 +- .isort.cfg | 2 +- .travis.yml | 21 +- mail_all/__manifest__.py | 22 +- mail_all/models/__init__.py | 1 - mail_all/static/src/js/mail_all.js | 94 ++-- mail_all/static/src/xml/menu.xml | 11 +- mail_all/tests/test_js.py | 7 +- mail_all/views/templates.xml | 15 +- mail_archives/__init__.py | 1 - mail_archives/__manifest__.py | 23 +- mail_archives/static/src/js/archives.js | 134 ++--- mail_archives/static/src/xml/menu.xml | 11 +- mail_archives/tests/test_js.py | 10 +- mail_archives/views/templates.xml | 15 +- mail_attachment_popup/__manifest__.py | 21 +- .../static/src/css/jquery.arcticmodal.css | 51 +- .../static/src/css/simple.css | 32 +- .../static/src/xml/mail_attachment_popup.xml | 50 +- .../views/mail_attachment_popup_template.xml | 28 +- mail_base/__manifest__.py | 18 +- mail_base/controllers/__init__.py | 1 + mail_base/controllers/main.py | 6 +- mail_base/models.py | 18 +- mail_base/views/templates.xml | 12 +- mail_check_immediately/__manifest__.py | 26 +- mail_check_immediately/models.py | 49 +- mail_check_immediately/static/src/js/main.js | 52 +- .../static/src/xml/main.xml | 14 +- mail_check_immediately/views.xml | 11 +- mail_fix_553/__manifest__.py | 4 +- mail_fix_553/data.xml | 2 +- mail_fix_553/mail_fix_553.py | 147 ++++-- mail_move_message/__manifest__.py | 31 +- mail_move_message/controllers/main.py | 46 +- .../data/mail_move_message_data.xml | 2 +- mail_move_message/doc/index.rst | 1 - mail_move_message/mail_move_message_models.py | 452 +++++++++------- mail_move_message/mail_move_message_views.xml | 170 +++++-- .../static/src/css/mail_move_message.css | 5 +- .../static/src/js/mail_move_message.js | 119 +++-- .../static/src/xml/mail_move_message_main.xml | 10 +- mail_private/__manifest__.py | 21 +- mail_private/full_composer_wizard.xml | 16 +- mail_private/models.py | 85 +++- mail_private/static/src/js/mail_private.js | 481 ++++++++++-------- mail_private/static/src/js/test_private.js | 43 +- mail_private/static/src/xml/mail_private.xml | 25 +- mail_private/template.xml | 19 +- mail_private/tests/test_js.py | 16 +- mail_recovery/__init__.py | 1 - mail_recovery/__manifest__.py | 22 +- mail_recovery/data.xml | 13 +- mail_recovery/static/src/js/mail_recovery.js | 14 +- mail_reply/__init__.py | 1 - mail_reply/__manifest__.py | 16 +- mail_reply/static/src/js/mail_reply.js | 73 +-- mail_reply/static/src/xml/reply_button.xml | 14 +- mail_reply/templates.xml | 15 +- mail_sent/__manifest__.py | 25 +- mail_sent/models.py | 30 +- mail_sent/static/src/js/sent.js | 119 ++--- mail_sent/static/src/xml/menu.xml | 14 +- mail_sent/tests/test_js.py | 10 +- mail_sent/views/templates.xml | 12 +- mail_to/__manifest__.py | 16 +- mail_to/models/mail_message.py | 13 +- mail_to/static/src/js/mail_to.js | 28 +- mail_to/static/src/js/test_mail_to.js | 19 +- mail_to/static/src/xml/recipient.xml | 31 +- mail_to/templates.xml | 22 +- mail_to/tests/test_default.py | 16 +- mailgun/__manifest__.py | 18 +- mailgun/controllers/main.py | 16 +- mailgun/data/cron.xml | 2 +- mailgun/doc/index.rst | 11 +- mailgun/models.py | 35 +- res_partner_company_messages/__manifest__.py | 22 +- res_partner_company_messages/models.py | 18 +- res_partner_company_messages/views.xml | 2 +- res_partner_mails_count/__manifest__.py | 14 +- res_partner_mails_count/models.py | 14 +- .../src/js/res_partner_mails_count_tour.js | 44 +- res_partner_mails_count/templates.xml | 35 +- res_partner_mails_count/tests/__init__.py | 1 + res_partner_mails_count/tests/test_mail.py | 64 ++- res_partner_mails_count/tests/test_phantom.py | 17 +- .../views/res_partner_mails_count.xml | 2 +- 90 files changed, 1907 insertions(+), 1392 deletions(-) diff --git a/.DINAR/image/README.md b/.DINAR/image/README.md index 8175f2a..e6e2e05 100644 --- a/.DINAR/image/README.md +++ b/.DINAR/image/README.md @@ -1,2 +1,4 @@ -This folder is attached on image building as `custom/` folder in [doobba](https://github.com/Tecnativa/doodba#image-usage). -Few additional [files](https://github.com/itpp-labs/DINAR/tree/master/embedded-files/.DINAR/image) are attached temporary on image building. +This folder is attached on image building as `custom/` folder in +[doobba](https://github.com/Tecnativa/doodba#image-usage). Few additional +[files](https://github.com/itpp-labs/DINAR/tree/master/embedded-files/.DINAR/image) are +attached temporary on image building. diff --git a/.DINAR/image/src/addons.yaml b/.DINAR/image/src/addons.yaml index 3689f07..9d0e1c7 100644 --- a/.DINAR/image/src/addons.yaml +++ b/.DINAR/image/src/addons.yaml @@ -1,5 +1,4 @@ # see https://github.com/Tecnativa/doodba#optodoocustomsrcaddonsyaml - --- ENV: DEFAULT_REPO_PATTERN: https://github.com/it-projects-llc/{}.git diff --git a/.eslintrc.yml b/.eslintrc.yml index 9657d44..0b81ecd 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -133,7 +133,7 @@ rules: no-unused-labels: error no-unused-vars: - error - - args: none + - args: none no-use-before-define: error no-useless-call: warn no-useless-computed-key: warn diff --git a/.isort.cfg b/.isort.cfg index 5751c40..249c22f 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -9,4 +9,4 @@ line_length=88 known_odoo=odoo known_odoo_addons=odoo.addons sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER -known_third_party= +known_third_party=openerp,requests,simplejson diff --git a/.travis.yml b/.travis.yml index 543981e..8e05c39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,27 +11,28 @@ addons: postgresql: "9.5" apt: packages: - - expect-dev # provides unbuffer utility - - python-lxml # because pip installation is slow + - expect-dev # provides unbuffer utility + - python-lxml # because pip installation is slow env: global: - - VERSION="10.0" TESTS="0" LINT_CHECK="0" UNIT_TEST="0" - - PYLINT_ODOO_JSLINTRC="/home/travis/maintainer-quality-tools/travis/cfg/.jslintrc" + - VERSION="10.0" TESTS="0" LINT_CHECK="0" UNIT_TEST="0" + - PYLINT_ODOO_JSLINTRC="/home/travis/maintainer-quality-tools/travis/cfg/.jslintrc" matrix: - - LINT_CHECK="1" - - CHECK_TAGS="1" - - TESTS="1" ODOO_REPO="odoo/odoo" - - MAKEPOT="1" - - TESTS="1" ODOO_REPO="OCA/OCB" + - LINT_CHECK="1" + - CHECK_TAGS="1" + - TESTS="1" ODOO_REPO="odoo/odoo" + - MAKEPOT="1" + - TESTS="1" ODOO_REPO="OCA/OCB" virtualenv: system_site_packages: true install: - pip install anybox.testing.openerp - - git clone https://github.com/it-projects-llc/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools + - git clone https://github.com/it-projects-llc/maintainer-quality-tools.git + ${HOME}/maintainer-quality-tools - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} - travis_install_nightly diff --git a/mail_all/__manifest__.py b/mail_all/__manifest__.py index f9b4d39..c4c4136 100644 --- a/mail_all/__manifest__.py +++ b/mail_all/__manifest__.py @@ -3,27 +3,19 @@ "name": "Show all messages", "summary": """Checkout all messages where you have access""", "category": "Discuss", - "images": ['images/1.jpg'], + "images": ["images/1.jpg"], "version": "1.0.0", - "author": "IT-Projects LLC, Pavel Romanchenko", "support": "apps@it-projects.info", "website": "https://it-projects.info", "license": "LGPL-3", - 'price': 40.00, - 'currency': 'EUR', - - "depends": [ - "mail_base" - ], + "price": 40.00, + "currency": "EUR", + "depends": ["mail_base"], "external_dependencies": {"python": [], "bin": []}, - "data": [ - "views/templates.xml", - ], - "qweb": [ - "static/src/xml/menu.xml", - ], + "data": ["views/templates.xml",], + "qweb": ["static/src/xml/menu.xml",], "demo": [], - 'installable': True, + "installable": True, "auto_install": False, } diff --git a/mail_all/models/__init__.py b/mail_all/models/__init__.py index 40a96af..e69de29 100644 --- a/mail_all/models/__init__.py +++ b/mail_all/models/__init__.py @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/mail_all/static/src/js/mail_all.js b/mail_all/static/src/js/mail_all.js index 467ac11..b4e25f3 100644 --- a/mail_all/static/src/js/mail_all.js +++ b/mail_all/static/src/js/mail_all.js @@ -1,65 +1,67 @@ -odoo.define('mail_all.all', function (require) { -"use strict"; +odoo.define("mail_all.all", function(require) { + "use strict"; -var base_obj = require('mail_base.base'); + var base_obj = require("mail_base.base"); -//------------------------------------------------------------------------------- -var bus = require('bus.bus').bus; -var config = require('web.config'); -var core = require('web.core'); -var data = require('web.data'); -var Model = require('web.Model'); -var session = require('web.session'); -var time = require('web.time'); -var web_client = require('web.web_client'); + // ------------------------------------------------------------------------------- + var bus = require("bus.bus").bus; + var config = require("web.config"); + var core = require("web.core"); + var data = require("web.data"); + var Model = require("web.Model"); + var session = require("web.session"); + var time = require("web.time"); + var web_client = require("web.web_client"); -var _lt = core._lt; -//------------------------------------------------------------------------------- + var _lt = core._lt; + // ------------------------------------------------------------------------------- -var ChatAction = core.action_registry.get('mail.chat.instant_messaging'); -ChatAction.include({ - get_thread_rendering_options: function (messages) { - var options = this._super.apply(this, arguments); - options.display_subject = options.display_subject || this.channel.id === "channel_all"; - return options; - } -}); + var ChatAction = core.action_registry.get("mail.chat.instant_messaging"); + ChatAction.include({ + get_thread_rendering_options: function(messages) { + var options = this._super.apply(this, arguments); + options.display_subject = + options.display_subject || this.channel.id === "channel_all"; + return options; + }, + }); -// Inherit class and override methods -base_obj.MailTools.include({ - get_properties: function(msg){ - var properties = this._super.apply(this, arguments); - properties.is_all = this.property_descr("channel_all", msg, this); - return properties; - }, + // Inherit class and override methods + base_obj.MailTools.include({ + get_properties: function(msg) { + var properties = this._super.apply(this, arguments); + properties.is_all = this.property_descr("channel_all", msg, this); + return properties; + }, - set_channel_flags: function(data, msg){ - this._super.apply(this, arguments); - msg.is_all = data.author_id != 'ODOOBOT'; - return msg; - }, + set_channel_flags: function(data, msg) { + this._super.apply(this, arguments); + msg.is_all = data.author_id != "ODOOBOT"; + return msg; + }, - get_channel_array: function(msg){ - var arr = this._super.apply(this, arguments); - return arr.concat('channel_all'); - }, + get_channel_array: function(msg) { + var arr = this._super.apply(this, arguments); + return arr.concat("channel_all"); + }, - get_domain: function(channel){ - return (channel.id === "channel_all") ? [] : this._super.apply(this, arguments); - } -}); + get_domain: function(channel) { + return channel.id === "channel_all" + ? [] + : this._super.apply(this, arguments); + }, + }); -base_obj.chat_manager.is_ready.then(function(){ + base_obj.chat_manager.is_ready.then(function() { // Add all channel base_obj.chat_manager.mail_tools.add_channel({ id: "channel_all", name: _lt("All messages"), - type: "static" + type: "static", }); return $.when(); }); -return base_obj.chat_manager; - + return base_obj.chat_manager; }); diff --git a/mail_all/static/src/xml/menu.xml b/mail_all/static/src/xml/menu.xml index 8ad1bcb..b6d2ee3 100644 --- a/mail_all/static/src/xml/menu.xml +++ b/mail_all/static/src/xml/menu.xml @@ -1,10 +1,15 @@ - +