From 47e2d3efd1f4feb88107ad6d8952d40b1881de6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Didderen?= Date: Sun, 13 Aug 2023 17:44:42 +0200 Subject: [PATCH 1/2] update CI config --- .copier-answers.yml | 23 +++++---- .eslintrc.yml | 11 +++- .flake8 | 4 +- .gitignore | 15 ++++++ .gitlab-ci.yml | 14 +++++ .isort.cfg | 1 + .pre-commit-config.yaml | 51 ++++++++++--------- .pylintrc | 4 +- .pylintrc-mandatory | 3 +- README.md | 21 ++++++-- account_ebics/__manifest__.py | 2 +- account_ebics_batch/__manifest__.py | 2 +- .../wizards/account_statement_import.py | 2 +- .../wizards/account_bank_statement_import.py | 2 +- 14 files changed, 109 insertions(+), 46 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.copier-answers.yml b/.copier-answers.yml index 36ee1cf..f061478 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,13 +1,14 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.1.1 -_src_path: gh:oca/oca-addons-repo-template -dependency_installation_mode: PIP -generate_requirements_txt: true -include_wkhtmltopdf: false +_commit: v1.2 +_src_path: https://picasso.noviat.com/ci/addons-repo-template.git +ci_exclude_modules: account_asset +ci_image: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest +customer_slug: Noviat_Generic +odoo_enterprise: 1 odoo_version: 14.0 -rebel_module_groups: [] -repo_description: "TODO: add repo description." -repo_name: web -repo_slug: web -travis_apt_packages: [] -travis_apt_sources: [] +org_name: Noviat +org_slug: Noviat +repo_name: Modules dedicated to manage the EBICS protocol +repo_slug: accounting-ebics +repo_website: https://www.noviat.com/ + diff --git a/.eslintrc.yml b/.eslintrc.yml index 88f2881..9429bc6 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -1,9 +1,16 @@ env: browser: true + es6: true # See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 parserOptions: - ecmaVersion: 2017 + ecmaVersion: 2019 + +overrides: + - files: + - "**/*.esm.js" + parserOptions: + sourceType: module # Globals available in Odoo that shouldn't produce errorings globals: @@ -14,7 +21,7 @@ globals: moment: readonly odoo: readonly openerp: readonly - Promise: readonly + owl: readonly # Styling is handled by Prettier, so we only need to enable AST rules; # see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890 diff --git a/.flake8 b/.flake8 index 44ed868..e397e8e 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] -max-line-length = 80 +max-line-length = 88 max-complexity = 16 # B = bugbear # B9 = bugbear opinionated (incl line length) @@ -8,3 +8,5 @@ select = C,E,F,W,B,B9 # E501: flake8 line length (covered by bugbear B950) # W503: line break before binary operator (black behaviour) ignore = E203,E501,W503 +per-file-ignores= + __init__.py:F401 diff --git a/.gitignore b/.gitignore index 8c376df..4b87926 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] +/.venv +/.pytest_cache # C extensions *.so @@ -40,6 +42,19 @@ coverage.xml # Pycharm .idea +# Eclipse +.settings + +# Visual Studio cache/options directory +.vs/ +.vscode + +# OSX Files +.DS_Store + +# Django stuff: +*.log + # Mr Developer .mr.developer.cfg .project diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..17d810d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,14 @@ +include: + - project: "ci/gitlabci-odoo" + ref: main + file: "/odoo-tests.template.yml" + +variables: + ODOO_CI_IMAGE: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest + PRECOMMIT_IMAGE: python:3.6 + VERSION: "14.0" + ODOO_BRANCH: "14.0" + ENTERPRISE: "1" + ODOO_PRECOMMIT: "1" + ODOO_TEST: "1" + EXCLUDE_MODULES: "account_asset" diff --git a/.isort.cfg b/.isort.cfg index 7683bad..0ec187e 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -10,3 +10,4 @@ known_odoo=odoo known_odoo_addons=odoo.addons sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER default_section=THIRDPARTY +ensure_newline_before_comments = True diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 307de0e..3da2184 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ exclude: | # Files and folders generated by bots, to avoid loops ^setup/|/static/description/index\.html$| # We don't want to mess with tool-generated files - .svg$| + .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/| # Maybe reactivate this when all README files include prettier ignore tags? ^README\.md$| # Library files can have extraneous formatting (even minimized) @@ -14,9 +14,11 @@ exclude: | ^docs/_templates/.*\.html$| # You don't usually want a bot to modify your legal texts (LICENSE.*|COPYING.*) + # Exclude the TODO folders + /TODO/ default_language_version: python: python3 - node: "14.13.0" + node: "16.10.0" repos: - repo: local hooks: @@ -27,32 +29,44 @@ repos: entry: found forbidden files; remove them language: fail files: "\\.rej$" + - id: en-po-files + name: en.po files cannot exist + entry: found a en.po file + language: fail + files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/oca/maintainer-tools rev: ab1d7f6 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons - # - id: oca-fix-manifest-website - # args: ["https://github.com/OCA/web"] + - id: oca-fix-manifest-website + args: ["https://www.noviat.com/"] - repo: https://github.com/myint/autoflake rev: v1.4 hooks: - id: autoflake - args: ["-i", "--ignore-init-module-imports"] + args: + - --expand-star-imports + - --ignore-init-module-imports + - --in-place + - --remove-all-unused-imports + - --remove-duplicate-keys + - --remove-unused-variables - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.3.0 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.1.2 hooks: - id: prettier - name: prettier + plugin-xml + name: prettier (with plugin-xml) additional_dependencies: - "prettier@2.1.2" - "@prettier/plugin-xml@0.12.0" args: - --plugin=@prettier/plugin-xml + files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ - repo: https://github.com/pre-commit/mirrors-eslint rev: v7.8.1 hooks: @@ -87,6 +101,7 @@ repos: rev: v2.7.2 hooks: - id: pyupgrade + args: ["--keep-percent-format"] - repo: https://github.com/PyCQA/isort rev: 5.5.1 hooks: @@ -96,7 +111,7 @@ repos: - --settings=. exclude: /__init__\.py$ - repo: https://github.com/acsone/setuptools-odoo - rev: 2.6.0 + rev: 3.1.8 hooks: - id: setuptools-odoo-make-default - id: setuptools-odoo-get-requirements @@ -109,27 +124,17 @@ repos: rev: 3.8.3 hooks: - id: flake8 - name: flake8 except __init__.py - exclude: /__init__\.py$ + name: flake8 additional_dependencies: ["flake8-bugbear==20.1.4"] - - id: flake8 - name: flake8 only __init__.py - args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py - files: /__init__\.py$ - additional_dependencies: ["flake8-bugbear==20.1.4"] - - repo: https://github.com/PyCQA/pylint - rev: pylint-2.5.3 + - repo: https://github.com/OCA/pylint-odoo + rev: 7.0.2 hooks: - - id: pylint + - id: pylint_odoo name: pylint with optional checks args: - --rcfile=.pylintrc - --exit-zero verbose: true - additional_dependencies: &pylint_deps - - pylint-odoo==3.5.0 - - id: pylint - name: pylint with mandatory checks + - id: pylint_odoo args: - --rcfile=.pylintrc-mandatory - additional_dependencies: *pylint_deps diff --git a/.pylintrc b/.pylintrc index cdc64ae..48b4902 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,4 +1,6 @@ + [MASTER] +ignore-patterns=["^.*/TODO/.*$"] load-plugins=pylint_odoo score=n @@ -73,7 +75,7 @@ enable=anomalous-backslash-in-string, invalid-commit, missing-manifest-dependency, missing-newline-extrafiles, - # missing-readme, + missing-readme, no-utf8-coding-comment, odoo-addons-relative-import, old-api7-method-defined, diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 3c61cdc..c73ffe4 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -1,9 +1,10 @@ [MASTER] +ignore-patterns=["^.*/TODO/.*$"] load-plugins=pylint_odoo score=n [ODOOLINT] -readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" +# readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" manifest_required_authors=Noviat manifest_required_keys=license manifest_deprecated_keys=description,active diff --git a/README.md b/README.md index 5c877ce..416b2cc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,20 @@ -![Licence](https://img.shields.io/badge/licence-AGPL--3-blue.svg) +[![pipeline status](https://picasso.noviat.com/Noviat/Noviat_Generic/accounting-ebics/badges/14.0/pipeline.svg)](https://picasso.noviat.com/Noviat/Noviat_Generic/accounting-ebics/-/commits/14.0) +[![coverage report](https://picasso.noviat.com/Noviat/Noviat_Generic/accounting-ebics/badges/14.0/coverage.svg)](https://picasso.noviat.com/Noviat/Noviat_Generic/accounting-ebics/-/commits/14.0) -EBICS support for Odoo -====================== + +# Modules dedicated to manage the EBICS protocol + + + + + +[//]: # (addons) + +This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools. + +[//]: # (end addons) + + + +---- diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py index e7bd55e..fbcf720 100644 --- a/account_ebics/__manifest__.py +++ b/account_ebics/__manifest__.py @@ -6,7 +6,7 @@ "version": "14.0.1.1.3", "license": "LGPL-3", "author": "Noviat", - "website": "https://www.noviat.com", + "website": "https://www.noviat.com/", "category": "Accounting & Finance", "depends": ["account"], "data": [ diff --git a/account_ebics_batch/__manifest__.py b/account_ebics_batch/__manifest__.py index b577ee2..5590074 100644 --- a/account_ebics_batch/__manifest__.py +++ b/account_ebics_batch/__manifest__.py @@ -6,7 +6,7 @@ "version": "14.0.1.0.0", "license": "AGPL-3", "author": "Noviat", - "website": "http://www.noviat.com", + "website": "https://www.noviat.com/", "category": "Accounting & Finance", "summary": "EBICS Files automated import and processing", "depends": ["account_ebics"], diff --git a/account_ebics_oca_statement_import/wizards/account_statement_import.py b/account_ebics_oca_statement_import/wizards/account_statement_import.py index d88b825..c344a76 100644 --- a/account_ebics_oca_statement_import/wizards/account_statement_import.py +++ b/account_ebics_oca_statement_import/wizards/account_statement_import.py @@ -12,7 +12,7 @@ class AccountStatementImport(models.TransientModel): _inherit = "account.statement.import" def _check_parsed_data(self, stmts_vals): - """ Basic and structural verifications """ + """Basic and structural verifications""" if self.env.context.get("active_model") == "ebics.file": message = False if len(stmts_vals) == 0: diff --git a/account_ebics_oe_statement_import/wizards/account_bank_statement_import.py b/account_ebics_oe_statement_import/wizards/account_bank_statement_import.py index 3748d31..03324a6 100644 --- a/account_ebics_oe_statement_import/wizards/account_bank_statement_import.py +++ b/account_ebics_oe_statement_import/wizards/account_bank_statement_import.py @@ -12,7 +12,7 @@ class AccountBankStatementImport(models.TransientModel): _inherit = "account.bank.statement.import" def _check_parsed_data(self, stmts_vals, account_number): - """ Basic and structural verifications """ + """Basic and structural verifications""" if self.env.context.get("active_model") == "ebics.file": message = False if len(stmts_vals) == 0: From 2a144d28bbb403ce56751d9283ca7e89e9710caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Didderen?= Date: Sun, 13 Aug 2023 17:54:05 +0200 Subject: [PATCH 2/2] add missing website keys --- account_ebics_batch_payment/__manifest__.py | 1 + account_ebics_oca_statement_import/__manifest__.py | 1 + account_ebics_oe/__manifest__.py | 1 + account_ebics_oe_statement_import/__manifest__.py | 1 + account_ebics_payment_order/__manifest__.py | 1 + 5 files changed, 5 insertions(+) diff --git a/account_ebics_batch_payment/__manifest__.py b/account_ebics_batch_payment/__manifest__.py index 33e0e0e..4620237 100644 --- a/account_ebics_batch_payment/__manifest__.py +++ b/account_ebics_batch_payment/__manifest__.py @@ -6,6 +6,7 @@ "version": "14.0.1.1.0", "license": "LGPL-3", "author": "Noviat", + "website": "https://www.noviat.com/", "category": "Accounting & Finance", "depends": ["account_ebics", "account_batch_payment"], "data": ["views/account_batch_payment_views.xml"], diff --git a/account_ebics_oca_statement_import/__manifest__.py b/account_ebics_oca_statement_import/__manifest__.py index 8f6fd58..8db20f6 100644 --- a/account_ebics_oca_statement_import/__manifest__.py +++ b/account_ebics_oca_statement_import/__manifest__.py @@ -6,6 +6,7 @@ "summary": "Use OCA Bank Statement Import with account_ebics", "version": "14.0.1.0.1", "author": "Noviat", + "website": "https://www.noviat.com/", "category": "Hidden", "license": "LGPL-3", "depends": [ diff --git a/account_ebics_oe/__manifest__.py b/account_ebics_oe/__manifest__.py index 96defec..8e9f8d4 100644 --- a/account_ebics_oe/__manifest__.py +++ b/account_ebics_oe/__manifest__.py @@ -6,6 +6,7 @@ "summary": "Deploy account_ebics module on Odoo Enterprise", "version": "14.0.1.0.0", "author": "Noviat", + "website": "https://www.noviat.com/", "category": "Hidden", "license": "LGPL-3", "depends": [ diff --git a/account_ebics_oe_statement_import/__manifest__.py b/account_ebics_oe_statement_import/__manifest__.py index c0b0337..e8bdb90 100644 --- a/account_ebics_oe_statement_import/__manifest__.py +++ b/account_ebics_oe_statement_import/__manifest__.py @@ -6,6 +6,7 @@ "summary": "Use Odoo Enterprise Bank Statement Import with account_ebics", "version": "14.0.1.0.0", "author": "Noviat", + "website": "https://www.noviat.com/", "category": "Hidden", "license": "LGPL-3", "depends": [ diff --git a/account_ebics_payment_order/__manifest__.py b/account_ebics_payment_order/__manifest__.py index c7e856f..0a7dd08 100644 --- a/account_ebics_payment_order/__manifest__.py +++ b/account_ebics_payment_order/__manifest__.py @@ -6,6 +6,7 @@ "version": "14.0.1.0.0", "license": "LGPL-3", "author": "Noviat", + "website": "https://www.noviat.com/", "category": "Accounting & Finance", "depends": ["account_ebics", "account_payment_order"], "data": [