From 54f1aebd4a39914ce29bacaf6fe703b0eee3728a Mon Sep 17 00:00:00 2001 From: "robin.keunen" Date: Sun, 14 Jun 2020 16:59:03 +0200 Subject: [PATCH] [REF] remove unused imports --- .eslintrc | 154 +++++++++++------- .isort.cfg | 20 +-- .pre-commit-config.yaml | 122 +++++++------- .travis.yml | 36 ++-- beesdoo_base/models/__init__.py | 2 +- beesdoo_base/models/membercard.py | 2 +- beesdoo_base/wizard/portal_wizard.py | 3 +- beesdoo_easy_my_coop/__init__.py | 2 +- beesdoo_easy_my_coop/controllers/main.py | 1 - beesdoo_easy_my_coop/models/__init__.py | 6 +- beesdoo_easy_my_coop/models/product.py | 1 - beesdoo_easy_my_coop/models/res_company.py | 3 +- .../models/subscription_request.py | 3 +- .../tests/test_res_partner.py | 1 - .../wizards/beesdoo_shift_subscribe.py | 3 +- beesdoo_inventory/models/stock.py | 2 +- beesdoo_shift/models/__init__.py | 4 +- beesdoo_shift/models/cooperative_status.py | 2 +- beesdoo_shift/models/res_partner.py | 4 - beesdoo_shift/wizard/__init__.py | 6 +- beesdoo_shift/wizard/assign_super_coop.py | 2 +- .../models/attendance_sheet.py | 6 +- .../models/res_config_settings.py | 2 - .../tests/test_beesdoo_shift.py | 3 +- beesdoo_shift_attendance/wizard/__init__.py | 2 +- .../generate_missing_attendance_sheets.py | 2 +- .../wizard/validate_attendance_sheet.py | 4 +- beesdoo_stock/models/stock.py | 2 +- beesdoo_website_shift/controllers/main.py | 3 +- beesdoo_website_shift/models/__init__.py | 2 +- beesdoo_website_shift/models/res_config.py | 4 +- .../models/cooperative_status.py | 6 +- beesdoo_worker_status/models/task.py | 6 +- .../tests/test_beesdoo_shift.py | 4 +- macavrac_base/models/res_partner.py | 4 +- purchase_order_generator/models/__init__.py | 2 +- 36 files changed, 222 insertions(+), 209 deletions(-) diff --git a/.eslintrc b/.eslintrc index 28a0808..bf9bc1c 100644 --- a/.eslintrc +++ b/.eslintrc @@ -52,9 +52,14 @@ "no-fallthrough": "warn", "no-floating-decimal": "warn", "no-func-assign": "warn", - "no-implicit-coercion": ["warn", { - "allow": ["~"] - }], + "no-implicit-coercion": [ + "warn", + { + "allow": [ + "~" + ] + } + ], "no-implicit-globals": "warn", "no-implied-eval": "warn", "no-inline-comments": "warn", @@ -147,19 +152,32 @@ "arrow-spacing": "off", "accessor-pairs": "warn", "block-scoped-var": "off", - "block-spacing": ["warn", "always"], + "block-spacing": [ + "warn", + "always" + ], "brace-style": "warn", "callback-return": "warn", "camelcase": "off", - "capitalized-comments": ["warn", "always", { - "ignoreConsecutiveComments": true, - "ignoreInlineComments": true - }], - "comma-dangle": ["warn", "always-multiline"], - "comma-spacing": ["warn", { - "before": false, - "after": true - }], + "capitalized-comments": [ + "warn", + "always", + { + "ignoreConsecutiveComments": true, + "ignoreInlineComments": true + } + ], + "comma-dangle": [ + "warn", + "always-multiline" + ], + "comma-spacing": [ + "warn", + { + "before": false, + "after": true + } + ], "comma-style": "warn", "complexity": [ "warn", @@ -171,7 +189,10 @@ "constructor-super": "warn", "curly": "warn", "default-case": "off", - "dot-location": ["warn", "property"], + "dot-location": [ + "warn", + "property" + ], "dot-notation": "warn", "eol-last": "warn", "eqeqeq": "warn", @@ -195,11 +216,14 @@ ], "lines-around-comment": "warn", "max-depth": "warn", - "max-len": ["warn", { - "code": 88, - "ignorePattern": "odoo\\.define\\(", - "tabWidth": 4 - }], + "max-len": [ + "warn", + { + "code": 88, + "ignorePattern": "odoo\\.define\\(", + "tabWidth": 4 + } + ], "max-lines": "off", "max-nested-callbacks": "warn", "max-params": "off", @@ -211,11 +235,22 @@ "newline-after-var": "off", "newline-before-return": "off", "newline-per-chained-call": "off", - "object-curly-newline": ["warn", { "consistent": true }], - "object-curly-spacing": ["warn", "never"], - "object-property-newline": ["warn", { - "allowAllPropertiesOnSameLine": true - }], + "object-curly-newline": [ + "warn", + { + "consistent": true + } + ], + "object-curly-spacing": [ + "warn", + "never" + ], + "object-property-newline": [ + "warn", + { + "allowAllPropertiesOnSameLine": true + } + ], "object-shorthand": "off", "one-var": "off", "one-var-declaration-per-line": "off", @@ -245,39 +280,48 @@ "space-in-parens": "off", "space-infix-ops": "off", "space-unary-ops": "off", - "spaced-comment": ["warn", "always"], - "strict": ["warn", "function"], + "spaced-comment": [ + "warn", + "always" + ], + "strict": [ + "warn", + "function" + ], "template-curly-spacing": "off", "unicode-bom": "warn", "use-isnan": "warn", - "valid-jsdoc": ["warn", { - "prefer": { - "arg": "param", - "argument": "param", - "augments": "extends", - "constructor": "class", - "exception": "throws", - "func": "function", - "method": "function", - "prop": "property", - "return": "returns", - "virtual": "abstract", - "yield": "yields" - }, - "preferType": { - "array": "Array", - "bool": "Boolean", - "boolean": "Boolean", - "number": "Number", - "object": "Object", - "str": "String", - "string": "String" - }, - "requireParamDescription": false, - "requireReturn": false, - "requireReturnDescription": false, - "requireReturnType": false - }], + "valid-jsdoc": [ + "warn", + { + "prefer": { + "arg": "param", + "argument": "param", + "augments": "extends", + "constructor": "class", + "exception": "throws", + "func": "function", + "method": "function", + "prop": "property", + "return": "returns", + "virtual": "abstract", + "yield": "yields" + }, + "preferType": { + "array": "Array", + "bool": "Boolean", + "boolean": "Boolean", + "number": "Number", + "object": "Object", + "str": "String", + "string": "String" + }, + "requireParamDescription": false, + "requireReturn": false, + "requireReturnDescription": false, + "requireReturnType": false + } + ], "valid-typeof": "warn", "vars-on-top": "off", "wrap-iife": "warn", @@ -286,6 +330,6 @@ "yoda": "warn" }, "parserOptions": { - "ecmaVersion": 2017 + "ecmaVersion": 2017 } } diff --git a/.isort.cfg b/.isort.cfg index 63ec6dd..bd8e906 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,12 +1,12 @@ [settings] ; see https://github.com/psf/black -multi_line_output=3 -include_trailing_comma=True -force_grid_wrap=0 -combine_as_imports=True -use_parentheses=True -line_length=79 -known_odoo=odoo -known_odoo_addons=odoo.addons -sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER -known_third_party=lxml,pytz +multi_line_output = 3 +include_trailing_comma = True +force_grid_wrap = 0 +combine_as_imports = True +use_parentheses = True +line_length = 79 +known_odoo = odoo +known_odoo_addons = odoo.addons +sections = FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER +known_third_party = pytz diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61b6aa5..1559ee2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,67 +1,67 @@ exclude: "^setup/|/static/lib/|/static/src/lib/" default_language_version: - python: python3 + python: python3 repos: -- repo: https://github.com/psf/black - rev: 19.3b0 - hooks: - - id: black - args: [-l 79] -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 - hooks: - - id: trailing-whitespace - # exclude autogenerated files - exclude: /README\.rst$|\.pot?$ - - id: end-of-file-fixer - # exclude autogenerated files - exclude: /README\.rst$|\.pot?$ - - id: debug-statements - - id: flake8 - name: flake8 except __init__.py - exclude: /__init__\.py$ - additional_dependencies: ["flake8-bugbear==19.8.0"] - - id: flake8 - name: flake8 only __init__.py - args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py - files: /__init__\.py$ - additional_dependencies: ["flake8-bugbear==19.8.0"] - - id: fix-encoding-pragma - args: ["--remove"] - - id: check-case-conflict - - id: check-docstring-first - - id: check-executables-have-shebangs - - id: check-merge-conflict - - id: check-symlinks - - id: check-xml - - id: mixed-line-ending - args: ["--fix=lf"] -- repo: https://github.com/pre-commit/mirrors-pylint - rev: v2.3.1 - hooks: - - id: pylint - name: pylint with optional checks - args: ["--rcfile=.pylintrc", "--exit-zero"] - verbose: true - additional_dependencies: ["pylint-odoo==3.0.3"] - - id: pylint - name: pylint with mandatory checks - args: ["--rcfile=.pylintrc-mandatory"] - additional_dependencies: ["pylint-odoo==3.0.3"] -- repo: https://github.com/asottile/pyupgrade - rev: v1.24.0 - hooks: - - id: pyupgrade -- repo: https://github.com/asottile/seed-isort-config - rev: v1.9.3 - hooks: - - id: seed-isort-config -- repo: https://github.com/pre-commit/mirrors-isort - rev: v4.3.21 - hooks: - - id: isort - name: isort except __init__.py - exclude: /__init__\.py$ + - repo: https://github.com/psf/black + rev: 19.3b0 + hooks: + - id: black + args: [-l 79] + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: trailing-whitespace + # exclude autogenerated files + exclude: /README\.rst$|\.pot?$ + - id: end-of-file-fixer + # exclude autogenerated files + exclude: /README\.rst$|\.pot?$ + - id: debug-statements + - id: flake8 + name: flake8 except __init__.py + exclude: /__init__\.py$ + additional_dependencies: ["flake8-bugbear==19.8.0"] + - id: flake8 + name: flake8 only __init__.py + args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py + files: /__init__\.py$ + additional_dependencies: ["flake8-bugbear==19.8.0"] + - id: fix-encoding-pragma + args: ["--remove"] + - id: check-case-conflict + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-symlinks + - id: check-xml + - id: mixed-line-ending + args: ["--fix=lf"] + - repo: https://github.com/pre-commit/mirrors-pylint + rev: v2.3.1 + hooks: + - id: pylint + name: pylint with optional checks + args: ["--rcfile=.pylintrc", "--exit-zero"] + verbose: true + additional_dependencies: ["pylint-odoo==3.0.3"] + - id: pylint + name: pylint with mandatory checks + args: ["--rcfile=.pylintrc-mandatory"] + additional_dependencies: ["pylint-odoo==3.0.3"] + - repo: https://github.com/asottile/pyupgrade + rev: v1.24.0 + hooks: + - id: pyupgrade + - repo: https://github.com/asottile/seed-isort-config + rev: v1.9.3 + hooks: + - id: seed-isort-config + - repo: https://github.com/pre-commit/mirrors-isort + rev: v4.3.21 + hooks: + - id: isort + name: isort except __init__.py + exclude: /__init__\.py$ #- repo: https://github.com/pre-commit/mirrors-eslint # rev: v6.5.1 # hooks: diff --git a/.travis.yml b/.travis.yml index bc71793..3e6fc17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,33 +3,33 @@ sudo: false cache: pip python: - - "3.5" + - "3.5" addons: - postgresql: "9.6" - apt: - packages: - - expect-dev # provides unbuffer utility + postgresql: "9.6" + apt: + packages: + - expect-dev # provides unbuffer utility env: - global: - - VERSION="12.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" + global: + - VERSION="12.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" - matrix: - - LINT_CHECK="1" - - TESTS="1" ODOO_REPO="OCA/OCB" - - TESTS="1" ODOO_REPO="OCA/OCB" UNIT_TEST="1" + matrix: + - LINT_CHECK="1" + - TESTS="1" ODOO_REPO="OCA/OCB" + - TESTS="1" ODOO_REPO="OCA/OCB" UNIT_TEST="1" install: - - git clone --depth=1 https://github.com/coopiteasy/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools - # Disable manifest-required-author for this repository - - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} - - travis_install_nightly - - pip install unidecode + - git clone --depth=1 https://github.com/coopiteasy/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools + # Disable manifest-required-author for this repository + - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} + - travis_install_nightly + - pip install unidecode script: - - travis_run_tests + - travis_run_tests after_success: - - travis_after_tests_success + - travis_after_tests_success diff --git a/beesdoo_base/models/__init__.py b/beesdoo_base/models/__init__.py index 1bff4b8..007bc83 100644 --- a/beesdoo_base/models/__init__.py +++ b/beesdoo_base/models/__init__.py @@ -1,2 +1,2 @@ -from . import partner from . import membercard +from . import partner diff --git a/beesdoo_base/models/membercard.py b/beesdoo_base/models/membercard.py index 4967350..c4e354d 100644 --- a/beesdoo_base/models/membercard.py +++ b/beesdoo_base/models/membercard.py @@ -1,6 +1,6 @@ import uuid -from odoo import api, fields, models +from odoo import fields, models class MemberCard(models.Model): diff --git a/beesdoo_base/wizard/portal_wizard.py b/beesdoo_base/wizard/portal_wizard.py index ef2b8e3..c8839c2 100644 --- a/beesdoo_base/wizard/portal_wizard.py +++ b/beesdoo_base/wizard/portal_wizard.py @@ -1,8 +1,7 @@ -from odoo import SUPERUSER_ID, api, fields, models +from odoo import api, models class BeesdooWizard(models.TransientModel): - _inherit = "portal.wizard" @api.onchange("portal_id") diff --git a/beesdoo_easy_my_coop/__init__.py b/beesdoo_easy_my_coop/__init__.py index 4ba7940..ada0b87 100644 --- a/beesdoo_easy_my_coop/__init__.py +++ b/beesdoo_easy_my_coop/__init__.py @@ -1,3 +1,3 @@ +from . import controllers from . import models from . import wizards -from . import controllers diff --git a/beesdoo_easy_my_coop/controllers/main.py b/beesdoo_easy_my_coop/controllers/main.py index c259a89..5c25286 100644 --- a/beesdoo_easy_my_coop/controllers/main.py +++ b/beesdoo_easy_my_coop/controllers/main.py @@ -1,4 +1,3 @@ -from odoo import http from odoo.http import request from odoo.addons.easy_my_coop_website.controllers.main import ( diff --git a/beesdoo_easy_my_coop/models/__init__.py b/beesdoo_easy_my_coop/models/__init__.py index bb81dfc..5bbc6e7 100644 --- a/beesdoo_easy_my_coop/models/__init__.py +++ b/beesdoo_easy_my_coop/models/__init__.py @@ -1,5 +1,5 @@ +from . import coop +from . import product +from . import res_company from . import res_partner from . import subscription_request -from . import res_company -from . import product -from . import coop diff --git a/beesdoo_easy_my_coop/models/product.py b/beesdoo_easy_my_coop/models/product.py index bc4c96d..9b9ca57 100644 --- a/beesdoo_easy_my_coop/models/product.py +++ b/beesdoo_easy_my_coop/models/product.py @@ -2,7 +2,6 @@ from odoo import fields, models class ProductTemplate(models.Model): - _inherit = "product.template" max_nb_eater_allowed = fields.Integer( diff --git a/beesdoo_easy_my_coop/models/res_company.py b/beesdoo_easy_my_coop/models/res_company.py index 0309714..9b362ea 100644 --- a/beesdoo_easy_my_coop/models/res_company.py +++ b/beesdoo_easy_my_coop/models/res_company.py @@ -1,11 +1,10 @@ # Copyright 2019 Coop IT Easy SCRLfs # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import api, fields, models class ResCompany(models.Model): - _inherit = "res.company" display_info_session_confirmation = fields.Boolean( help="Choose to display a info session checkbox on the cooperator" diff --git a/beesdoo_easy_my_coop/models/subscription_request.py b/beesdoo_easy_my_coop/models/subscription_request.py index b701d87..a0f4b55 100644 --- a/beesdoo_easy_my_coop/models/subscription_request.py +++ b/beesdoo_easy_my_coop/models/subscription_request.py @@ -1,11 +1,10 @@ # Copyright 2019 Coop IT Easy SCRLfs # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import fields, models class SubscriptionRequest(models.Model): - _inherit = "subscription.request" info_session_confirmed = fields.Boolean( diff --git a/beesdoo_easy_my_coop/tests/test_res_partner.py b/beesdoo_easy_my_coop/tests/test_res_partner.py index 0324362..82ac878 100644 --- a/beesdoo_easy_my_coop/tests/test_res_partner.py +++ b/beesdoo_easy_my_coop/tests/test_res_partner.py @@ -1,7 +1,6 @@ # Copyright 2020 Coop IT Easy SCRLfs () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import exceptions from odoo.exceptions import ValidationError from odoo.tests.common import TransactionCase diff --git a/beesdoo_easy_my_coop/wizards/beesdoo_shift_subscribe.py b/beesdoo_easy_my_coop/wizards/beesdoo_shift_subscribe.py index 6fea98d..7990b84 100644 --- a/beesdoo_easy_my_coop/wizards/beesdoo_shift_subscribe.py +++ b/beesdoo_easy_my_coop/wizards/beesdoo_shift_subscribe.py @@ -1,11 +1,10 @@ # Copyright 2019 Coop IT Easy SCRLfs # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import fields, models class Subscribe(models.TransientModel): - _inherit = "beesdoo.shift.subscribe" def _get_info_session_followed(self): diff --git a/beesdoo_inventory/models/stock.py b/beesdoo_inventory/models/stock.py index 7b5d8b9..8b3c09a 100644 --- a/beesdoo_inventory/models/stock.py +++ b/beesdoo_inventory/models/stock.py @@ -1,4 +1,4 @@ -from odoo import _, api, fields, models +from odoo import api, fields, models class StockPicking(models.Model): diff --git a/beesdoo_shift/models/__init__.py b/beesdoo_shift/models/__init__.py index a06e5b1..9f54249 100644 --- a/beesdoo_shift/models/__init__.py +++ b/beesdoo_shift/models/__init__.py @@ -1,4 +1,4 @@ -from . import task -from . import planning from . import cooperative_status +from . import planning from . import res_partner +from . import task diff --git a/beesdoo_shift/models/cooperative_status.py b/beesdoo_shift/models/cooperative_status.py index 63620e8..db26d05 100644 --- a/beesdoo_shift/models/cooperative_status.py +++ b/beesdoo_shift/models/cooperative_status.py @@ -1,5 +1,5 @@ import logging -from datetime import datetime, timedelta +from datetime import timedelta from odoo import _, api, fields, models from odoo.exceptions import UserError, ValidationError diff --git a/beesdoo_shift/models/res_partner.py b/beesdoo_shift/models/res_partner.py index 7323d7a..c499dec 100644 --- a/beesdoo_shift/models/res_partner.py +++ b/beesdoo_shift/models/res_partner.py @@ -1,8 +1,4 @@ -import logging -from datetime import datetime, timedelta - from odoo import _, api, fields, models -from odoo.exceptions import UserError, ValidationError class ResPartner(models.Model): diff --git a/beesdoo_shift/wizard/__init__.py b/beesdoo_shift/wizard/__init__.py index 6e8ad90..c07c8a5 100644 --- a/beesdoo_shift/wizard/__init__.py +++ b/beesdoo_shift/wizard/__init__.py @@ -1,7 +1,7 @@ -from . import instanciate_planning -from . import batch_template from . import assign_super_coop -from . import subscribe +from . import batch_template from . import extension from . import holiday +from . import instanciate_planning +from . import subscribe from . import temporary_exemption diff --git a/beesdoo_shift/wizard/assign_super_coop.py b/beesdoo_shift/wizard/assign_super_coop.py index 638e0b7..eedf611 100644 --- a/beesdoo_shift/wizard/assign_super_coop.py +++ b/beesdoo_shift/wizard/assign_super_coop.py @@ -1,4 +1,4 @@ -from odoo import _, api, fields, models +from odoo import api, fields, models class AssignSuperCoop(models.TransientModel): diff --git a/beesdoo_shift_attendance/models/attendance_sheet.py b/beesdoo_shift_attendance/models/attendance_sheet.py index 223f969..1765578 100644 --- a/beesdoo_shift_attendance/models/attendance_sheet.py +++ b/beesdoo_shift_attendance/models/attendance_sheet.py @@ -1,9 +1,7 @@ from datetime import date, datetime, timedelta -from lxml import etree - -from odoo import _, api, exceptions, fields, models -from odoo.exceptions import UserError, ValidationError +from odoo import _, api, fields, models +from odoo.exceptions import UserError class AttendanceSheetShift(models.Model): diff --git a/beesdoo_shift_attendance/models/res_config_settings.py b/beesdoo_shift_attendance/models/res_config_settings.py index 3c32859..eb721c9 100644 --- a/beesdoo_shift_attendance/models/res_config_settings.py +++ b/beesdoo_shift_attendance/models/res_config_settings.py @@ -1,8 +1,6 @@ # Copyright 2019-2020 Elouan Le Bars # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -import ast - from odoo import api, fields, models diff --git a/beesdoo_shift_attendance/tests/test_beesdoo_shift.py b/beesdoo_shift_attendance/tests/test_beesdoo_shift.py index 7bfeba3..980bfed 100644 --- a/beesdoo_shift_attendance/tests/test_beesdoo_shift.py +++ b/beesdoo_shift_attendance/tests/test_beesdoo_shift.py @@ -4,8 +4,7 @@ import time from datetime import datetime, timedelta -from odoo import exceptions, fields -from odoo.exceptions import UserError, ValidationError +from odoo.exceptions import UserError from odoo.tests.common import TransactionCase diff --git a/beesdoo_shift_attendance/wizard/__init__.py b/beesdoo_shift_attendance/wizard/__init__.py index 46a772b..7b48387 100644 --- a/beesdoo_shift_attendance/wizard/__init__.py +++ b/beesdoo_shift_attendance/wizard/__init__.py @@ -1,2 +1,2 @@ -from . import validate_attendance_sheet from . import generate_missing_attendance_sheets +from . import validate_attendance_sheet diff --git a/beesdoo_shift_attendance/wizard/generate_missing_attendance_sheets.py b/beesdoo_shift_attendance/wizard/generate_missing_attendance_sheets.py index 33539fd..6a7afce 100644 --- a/beesdoo_shift_attendance/wizard/generate_missing_attendance_sheets.py +++ b/beesdoo_shift_attendance/wizard/generate_missing_attendance_sheets.py @@ -1,7 +1,7 @@ from datetime import datetime from odoo import _, api, fields, models -from odoo.exceptions import UserError, ValidationError +from odoo.exceptions import UserError class GenerateMissingAttendanceSheets(models.TransientModel): diff --git a/beesdoo_shift_attendance/wizard/validate_attendance_sheet.py b/beesdoo_shift_attendance/wizard/validate_attendance_sheet.py index 2cbb226..44426e3 100644 --- a/beesdoo_shift_attendance/wizard/validate_attendance_sheet.py +++ b/beesdoo_shift_attendance/wizard/validate_attendance_sheet.py @@ -1,7 +1,7 @@ import ast -from odoo import _, api, exceptions, fields, models -from odoo.exceptions import UserError, ValidationError +from odoo import _, api, fields, models +from odoo.exceptions import UserError class ValidateAttendanceSheet(models.TransientModel): diff --git a/beesdoo_stock/models/stock.py b/beesdoo_stock/models/stock.py index 836e2b2..67464d4 100644 --- a/beesdoo_stock/models/stock.py +++ b/beesdoo_stock/models/stock.py @@ -1,4 +1,4 @@ -from odoo import api, fields, models +from odoo import api, models class StockPackOperation(models.Model): diff --git a/beesdoo_website_shift/controllers/main.py b/beesdoo_website_shift/controllers/main.py index 046b980..612bc1a 100644 --- a/beesdoo_website_shift/controllers/main.py +++ b/beesdoo_website_shift/controllers/main.py @@ -3,13 +3,12 @@ # Copyright 2017-2018 Thibault François # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from ast import literal_eval from datetime import datetime, timedelta from itertools import groupby from pytz import timezone, utc -from odoo import fields, http +from odoo import http from odoo.http import request from odoo.addons.beesdoo_shift.models.planning import float_to_time diff --git a/beesdoo_website_shift/models/__init__.py b/beesdoo_website_shift/models/__init__.py index 2f62010..97d663d 100644 --- a/beesdoo_website_shift/models/__init__.py +++ b/beesdoo_website_shift/models/__init__.py @@ -1,2 +1,2 @@ -from . import website from . import res_config +from . import website diff --git a/beesdoo_website_shift/models/res_config.py b/beesdoo_website_shift/models/res_config.py index c11dd93..26cdba9 100644 --- a/beesdoo_website_shift/models/res_config.py +++ b/beesdoo_website_shift/models/res_config.py @@ -1,9 +1,7 @@ # Copyright 2017-2020 Rémy Taymans # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from ast import literal_eval - -from odoo import api, fields, models +from odoo import fields, models class WebsiteShiftConfigSettings(models.TransientModel): diff --git a/beesdoo_worker_status/models/cooperative_status.py b/beesdoo_worker_status/models/cooperative_status.py index f4ab122..84c6d90 100644 --- a/beesdoo_worker_status/models/cooperative_status.py +++ b/beesdoo_worker_status/models/cooperative_status.py @@ -1,8 +1,4 @@ -import logging -from datetime import datetime, timedelta - -from odoo import _, api, fields, models -from odoo.exceptions import UserError, ValidationError +from odoo import api, fields, models from odoo.addons.beesdoo_shift.models.cooperative_status import add_days_delta diff --git a/beesdoo_worker_status/models/task.py b/beesdoo_worker_status/models/task.py index c3a799e..2e823f7 100644 --- a/beesdoo_worker_status/models/task.py +++ b/beesdoo_worker_status/models/task.py @@ -1,8 +1,4 @@ -import json -from datetime import datetime, timedelta - -from odoo import _, api, fields, models -from odoo.exceptions import UserError, ValidationError +from odoo import fields, models class Task(models.Model): diff --git a/beesdoo_worker_status/tests/test_beesdoo_shift.py b/beesdoo_worker_status/tests/test_beesdoo_shift.py index 58e200a..c3876c9 100644 --- a/beesdoo_worker_status/tests/test_beesdoo_shift.py +++ b/beesdoo_worker_status/tests/test_beesdoo_shift.py @@ -1,11 +1,9 @@ # Copyright 2019 - Today Coop IT Easy SCRLfs () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -import time from datetime import datetime, timedelta -from odoo import exceptions, fields -from odoo.exceptions import UserError, ValidationError +from odoo.exceptions import ValidationError from odoo.tests.common import TransactionCase diff --git a/macavrac_base/models/res_partner.py b/macavrac_base/models/res_partner.py index 998d971..202150c 100644 --- a/macavrac_base/models/res_partner.py +++ b/macavrac_base/models/res_partner.py @@ -1,9 +1,7 @@ -from odoo import _, api, fields, models -from odoo.exceptions import ValidationError +from odoo import api, fields, models class Partner(models.Model): - _inherit = "res.partner" date_stamp = fields.Date( diff --git a/purchase_order_generator/models/__init__.py b/purchase_order_generator/models/__init__.py index 78eefbf..bc9cade 100644 --- a/purchase_order_generator/models/__init__.py +++ b/purchase_order_generator/models/__init__.py @@ -1,4 +1,4 @@ +from . import product_template from . import purchase_order from . import purchase_order_generator from . import purchase_order_generator_line -from . import product_template