From 12751e9c9ba885377cae2eea48e1bb3c51b19e5c Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Wed, 12 Feb 2020 08:53:49 +0000 Subject: [PATCH 01/11] :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 | 24 +- mail_all/static/src/css/mail_all.css | 2 +- mail_all/static/src/js/mail_all.js | 93 ++-- mail_all/static/src/xml/menu.xml | 11 +- mail_all/tests/__init__.py | 1 - mail_all/tests/test_js.py | 7 +- mail_all/views/templates.xml | 17 +- mail_archives/__manifest__.py | 23 +- mail_archives/static/src/css/archives.css | 2 +- mail_archives/static/src/js/archives.js | 148 ++--- mail_archives/static/src/xml/menu.xml | 11 +- mail_archives/tests/__init__.py | 1 - mail_archives/tests/test_js.py | 10 +- mail_archives/views/templates.xml | 20 +- mail_base/__manifest__.py | 18 +- mail_base/controllers/main.py | 6 +- mail_base/models.py | 18 +- mail_base/tests/__init__.py | 1 - mail_base/tests/test_default.py | 7 +- 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 | 148 +++-- mail_move_message/__manifest__.py | 33 +- mail_move_message/controllers/main.py | 7 +- .../data/mail_move_message_data.xml | 3 +- mail_move_message/doc/index.rst | 6 +- mail_move_message/mail_move_message_models.py | 520 +++++++++++------- mail_move_message/mail_move_message_views.xml | 135 +++-- .../static/src/css/mail_move_message.css | 5 +- .../static/src/js/mail_move_message.js | 149 ++--- .../static/src/xml/mail_move_message_main.xml | 11 +- mail_move_message/tests/__init__.py | 1 - mail_move_message/tests/test_mail_move.py | 13 +- mail_multi_website/__init__.py | 18 +- mail_multi_website/__manifest__.py | 21 +- mail_multi_website/doc/index.rst | 2 +- mail_multi_website/models/ir_property.py | 12 +- mail_multi_website/models/mail_message.py | 8 +- mail_multi_website/models/mail_template.py | 112 ++-- mail_multi_website/models/mail_thread.py | 29 +- mail_multi_website/models/res_users.py | 16 +- mail_multi_website/models/website.py | 6 +- mail_multi_website/tests/test_fetch.py | 53 +- mail_multi_website/tests/test_mail_model.py | 16 +- mail_multi_website/tests/test_render.py | 116 ++-- mail_multi_website/tests/test_send.py | 49 +- mail_multi_website/views/website_views.xml | 6 +- .../wizard/mail_compose_message.py | 12 +- mail_private/__manifest__.py | 21 +- mail_private/full_composer_wizard.xml | 16 +- mail_private/models.py | 130 +++-- mail_private/static/src/css/mail_private.css | 9 +- mail_private/static/src/js/mail_private.js | 498 +++++++++-------- mail_private/static/src/js/test_private.js | 43 +- mail_private/static/src/xml/mail_private.xml | 27 +- mail_private/template.xml | 24 +- mail_private/tests/test_js.py | 20 +- mail_recovery/__manifest__.py | 22 +- mail_recovery/data.xml | 13 +- mail_recovery/static/src/js/mail_recovery.js | 14 +- mail_reply/__manifest__.py | 16 +- mail_reply/doc/index.rst | 2 +- mail_reply/static/src/js/mail_reply.js | 76 +-- mail_reply/static/src/xml/reply_button.xml | 14 +- mail_reply/templates.xml | 15 +- mail_reply/tests/__init__.py | 1 - mail_reply/tests/test_default.py | 7 +- mail_sent/__manifest__.py | 25 +- mail_sent/models.py | 30 +- mail_sent/static/src/css/sent.css | 2 +- mail_sent/static/src/js/sent.js | 114 ++-- mail_sent/static/src/xml/menu.xml | 14 +- mail_sent/tests/__init__.py | 1 - mail_sent/tests/test_js.py | 10 +- mail_sent/views/templates.xml | 14 +- mail_to/__manifest__.py | 16 +- mail_to/models/mail_message.py | 13 +- mail_to/static/src/js/mail_to.js | 52 +- 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 | 23 +- mailgun/controllers/main.py | 16 +- mailgun/data/ir_cron_data.xml | 6 +- mailgun/models/ir_config_parameter.py | 21 +- mailgun/models/mail_thread.py | 19 +- 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 | 15 +- .../src/js/res_partner_mails_count_tour.js | 44 +- res_partner_mails_count/templates.xml | 35 +- res_partner_mails_count/tests/__init__.py | 2 +- res_partner_mails_count/tests/test_mail.py | 65 ++- res_partner_mails_count/tests/test_phantom.py | 17 +- .../views/res_partner_mails_count.xml | 2 +- 109 files changed, 2177 insertions(+), 1620 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 74b5194..8cd0ae6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,24 +11,25 @@ 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="11.0" TESTS="0" LINT_CHECK="0" UNIT_TEST="0" - - PYLINT_ODOO_JSLINTRC="/home/travis/maintainer-quality-tools/travis/cfg/.jslintrc" + - VERSION="11.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" 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 1ffed98..f6e548b 100644 --- a/mail_all/__manifest__.py +++ b/mail_all/__manifest__.py @@ -3,34 +3,24 @@ "summary": """Checkout all messages where you have access""", "category": "Discuss", # "live_test_url": "", - "images": ['images/1.jpg'], + "images": ["images/1.jpg"], "version": "11.0.1.0.0", "application": False, - "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": [], - "post_load": None, "pre_init_hook": None, "post_init_hook": None, "uninstall_hook": None, - - 'installable': True, + "installable": True, "auto_install": False, } diff --git a/mail_all/static/src/css/mail_all.css b/mail_all/static/src/css/mail_all.css index 010e720..0b13d18 100644 --- a/mail_all/static/src/css/mail_all.css +++ b/mail_all/static/src/css/mail_all.css @@ -1,3 +1,3 @@ .o_channel_name.mail_all i { margin-right: 4px; -} \ No newline at end of file +} diff --git a/mail_all/static/src/js/mail_all.js b/mail_all/static/src/js/mail_all.js index 1873f9e..8c9f707 100644 --- a/mail_all/static/src/js/mail_all.js +++ b/mail_all/static/src/js/mail_all.js @@ -1,57 +1,56 @@ -odoo.define('mail_all.all', function (require) { -"use strict"; - -var chat_manager = require('mail_base.base').chat_manager; -var core = require('web.core'); - -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; - } -}); - -// override methods -var chat_manager_super = _.clone(chat_manager); - -chat_manager.get_properties = function (msg) { - var properties = chat_manager_super.get_properties.apply(this, arguments); - properties.is_all = this.property_descr("channel_all", msg, this); - return properties; -}; - -chat_manager.set_channel_flags = function (data, msg) { - chat_manager_super.set_channel_flags.apply(this, arguments); - msg.is_all = data.author_id !== 'ODOOBOT'; - return msg; -}; - -chat_manager.get_channel_array = function (msg) { - var arr = chat_manager_super.get_channel_array.apply(this, arguments); - return arr.concat('channel_all'); -}; - -chat_manager.get_domain = function (channel) { - return (channel.id === "channel_all") - ? [] - : chat_manager_super.get_domain.apply(this, arguments); -}; - +odoo.define("mail_all.all", function(require) { + "use strict"; + + var chat_manager = require("mail_base.base").chat_manager; + var core = require("web.core"); + + 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; + }, + }); -chat_manager.is_ready.then(function () { + // Override methods + var chat_manager_super = _.clone(chat_manager); + + chat_manager.get_properties = function(msg) { + var properties = chat_manager_super.get_properties.apply(this, arguments); + properties.is_all = this.property_descr("channel_all", msg, this); + return properties; + }; + + chat_manager.set_channel_flags = function(data, msg) { + chat_manager_super.set_channel_flags.apply(this, arguments); + msg.is_all = data.author_id !== "ODOOBOT"; + return msg; + }; + + chat_manager.get_channel_array = function(msg) { + var arr = chat_manager_super.get_channel_array.apply(this, arguments); + return arr.concat("channel_all"); + }; + + chat_manager.get_domain = function(channel) { + return channel.id === "channel_all" + ? [] + : chat_manager_super.get_domain.apply(this, arguments); + }; + + chat_manager.is_ready.then(function() { // Add all channel chat_manager.add_channel({ id: "channel_all", name: _lt("All messages"), - type: "static" + type: "static", }); return $.when(); }); -return chat_manager; - + return chat_manager; }); diff --git a/mail_all/static/src/xml/menu.xml b/mail_all/static/src/xml/menu.xml index 1ed9bdc..729a985 100644 --- a/mail_all/static/src/xml/menu.xml +++ b/mail_all/static/src/xml/menu.xml @@ -1,10 +1,15 @@ - +