diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 000000000..a25cfee05 --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,24 @@ +# Do NOT update manually; changes here will be overwritten by Copier +_commit: v1.1.5 +_src_path: git+https://github.com/OCA/oca-addons-repo-template +dependency_installation_mode: PIP +generate_requirements_txt: true +include_wkhtmltopdf: true +odoo_version: 13.0 +rebel_module_groups: [] +repo_description: 'This repository hosts alternative reporting engines to the ones + included on Odoo core (RML, QWeb and Webkit). + + + The convention is to use a suffix to each module to indicate that it''s for using + with that report engine (for example, account_invoice_report_birt or sale_order_report_pentaho). + + + It can contain also another utilities directly involved with reports (like merge/split + utils, checkers, signing tools and so on).' +repo_name: OCA alternative reporting engines and reporting utilities for Odoo +repo_slug: reporting-engine +travis_apt_packages: +- swig +- libreoffice +travis_apt_sources: [] diff --git a/.eslintrc.yml b/.eslintrc.yml index 88f2881b4..16a185f1b 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -1,5 +1,6 @@ env: browser: true + es6: true # See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 parserOptions: @@ -14,7 +15,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 44ed868f7..e397e8ed4 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/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..335381cb7 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,13 @@ +name: pre-commit + +on: + pull_request: + push: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: pre-commit/action@v2.0.0 diff --git a/.gitignore b/.gitignore index 890ff0109..818770fb1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] +/.venv +/.pytest_cache # C extensions *.so @@ -21,6 +23,7 @@ var/ *.egg-info/ .installed.cfg *.egg +*.eggs # Installer logs pip-log.txt @@ -40,6 +43,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 @@ -54,3 +70,6 @@ docs/_build/ # Backup files *~ *.swp + +# OCA rules +!static/lib/ diff --git a/.isort.cfg b/.isort.cfg index 26efd2909..0ec187efd 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -10,4 +10,4 @@ known_odoo=odoo known_odoo_addons=odoo.addons sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER default_section=THIRDPARTY -known_third_party=setuptools +ensure_newline_before_comments = True diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6c30e9008..bb1338d50 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,11 @@ exclude: | (?x) + # NOT INSTALLABLE ADDONS + # END NOT INSTALLABLE ADDONS # 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$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$| # Maybe reactivate this when all README files include prettier ignore tags? ^README\.md$| # Library files can have extraneous formatting (even minimized) @@ -14,25 +18,47 @@ default_language_version: python: python3 node: "14.13.0" repos: + - repo: local + hooks: + # These files are most likely copier diff rejection junks; if found, + # review them manually, fix the problem (if needed) and remove them + - id: forbidden-files + name: forbidden files + entry: found forbidden files; remove them + language: fail + files: "\\.rej$" + - 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/reporting-engine"] + - repo: https://github.com/myint/autoflake + rev: v1.4 + hooks: + - id: autoflake + 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: 19.10b0 hooks: - id: black - - repo: https://github.com/prettier/pre-commit - rev: "v1.19.1" + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v1.19.1 hooks: - id: prettier - # TODO Avoid awebdeveloper/pre-commit-prettier if possible - # HACK https://github.com/prettier/prettier/issues/7407 - - repo: https://github.com/awebdeveloper/pre-commit-prettier - rev: v0.0.1 - hooks: - - id: prettier - name: prettier xml plugin + name: prettier (with plugin-xml) + entry: prettier --write --list-different additional_dependencies: - "prettier@1.19.1" - "@prettier/plugin-xml@0.7.2" - files: \.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: v6.8.0 hooks: @@ -63,34 +89,11 @@ repos: - id: check-xml - id: mixed-line-ending args: ["--fix=lf"] - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 - hooks: - - 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"] - - repo: https://github.com/pre-commit/mirrors-pylint - rev: v2.5.3 - hooks: - - id: pylint - name: pylint with optional checks - args: ["--rcfile=.pylintrc", "--exit-zero"] - verbose: true - additional_dependencies: ["pylint-odoo==3.5.0"] - - id: pylint - name: pylint with mandatory checks - args: ["--rcfile=.pylintrc-mandatory"] - additional_dependencies: ["pylint-odoo==3.5.0"] - repo: https://github.com/asottile/pyupgrade rev: v1.26.2 hooks: - id: pyupgrade + args: ["--keep-percent-format"] - repo: https://github.com/pre-commit/mirrors-isort rev: v4.3.21 hooks: @@ -101,3 +104,25 @@ repos: rev: 2.5.2 hooks: - id: setuptools-odoo-make-default + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.7.9 + hooks: + - id: flake8 + name: flake8 + additional_dependencies: ["flake8-bugbear==19.8.0"] + - repo: https://github.com/pre-commit/mirrors-pylint + rev: v2.5.3 + hooks: + - id: pylint + 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 + args: + - --rcfile=.pylintrc-mandatory + additional_dependencies: *pylint_deps diff --git a/.prettierrc.yml b/.prettierrc.yml index fc5f3a7c4..5b6d4b361 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -5,4 +5,4 @@ printWidth: 88 proseWrap: always semi: true trailingComma: "es5" -xmlWhitespaceSensitivity: "ignore" +xmlWhitespaceSensitivity: "strict" diff --git a/.pylintrc b/.pylintrc index 485836baf..c3d75e12d 100644 --- a/.pylintrc +++ b/.pylintrc @@ -46,8 +46,6 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - missing-import-error, - missing-manifest-dependency, openerp-exception-warning, pointless-statement, pointless-string-statement, @@ -73,6 +71,7 @@ enable=anomalous-backslash-in-string, deprecated-module, file-not-used, invalid-commit, + missing-manifest-dependency, missing-newline-extrafiles, missing-readme, no-utf8-coding-comment, @@ -82,6 +81,7 @@ enable=anomalous-backslash-in-string, too-complex, unnecessary-utf8-coding-comment + [REPORTS] msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} output-format=colorized diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 55893fe8b..3e19630b6 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -39,8 +39,6 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - missing-import-error, - missing-manifest-dependency, openerp-exception-warning, pointless-statement, pointless-string-statement, diff --git a/.travis.yml b/.travis.yml index eeaeddfb5..195fde565 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,36 +12,30 @@ addons: apt: packages: - expect-dev # provides unbuffer utility - - libreoffice + - "swig" + - "libreoffice" stages: - - linting - test jobs: include: - - stage: linting - name: "pre-commit" - before_install: - install: pip install pre-commit - script: pre-commit run --all --show-diff-on-failure --verbose --color always - after_success: - stage: test env: - - TESTS="1" ODOO_REPO="odoo/odoo" MAKEPOT="1" + - TESTS=1 ODOO_REPO="odoo/odoo" MAKEPOT="1" - stage: test env: - - TESTS="1" ODOO_REPO="OCA/OCB" - + - TESTS=1 ODOO_REPO="OCA/OCB" env: global: - VERSION="13.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" + - WKHTMLTOPDF_VERSION="0.12.5" + - MQT_DEP=PIP install: - git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} - - export WKHTMLTOPDF_VERSION=0.12.4 - travis_install_nightly script: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..9ac71fee4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# OCA Guidelines + +Please follow the official guide from the +[OCA Guidelines page](https://odoo-community.org/page/contributing). + +## Project Specific Guidelines + + + +This project does not have specific coding guidelines. diff --git a/LICENSE b/LICENSE index e20b431bc..be3f7b28e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -GNU AFFERO GENERAL PUBLIC LICENSE + GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. @@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/README.md b/README.md index 4804d36ca..aa60f5784 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,40 @@ [![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat/143/13.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-reporting-engine-143) -[![Build Status](https://travis-ci.org/OCA/reporting-engine.svg?branch=13.0)](https://travis-ci.org/OCA/reporting-engine) -[![Coverage Status](https://img.shields.io/coveralls/OCA/reporting-engine.svg)](https://coveralls.io/r/OCA/reporting-engine?branch=13.0) +[![Build Status](https://travis-ci.com/OCA/reporting-engine.svg?branch=13.0)](https://travis-ci.com/OCA/reporting-engine) +[![codecov](https://codecov.io/gh/OCA/reporting-engine/branch/13.0/graph/badge.svg)](https://codecov.io/gh/OCA/reporting-engine) +[![Translation Status](https://translation.odoo-community.org/widgets/reporting-engine-13-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/reporting-engine-13-0/?utm_source=widget) -OCA alternative reporting engines and reporting utilities for Odoo -================================================================== + -This repository hosts alternative reporting engines to the ones included on Odoo core (RML, QWeb and Webkit). It is complemented with the ones that host the reports theirself: +# OCA alternative reporting engines and reporting utilities for Odoo -https://github.com/OCA/account-financial-reporting -https://github.com/OCA/purchase-reporting -https://github.com/OCA/sale-reporting -... +This repository hosts alternative reporting engines to the ones included on Odoo core (RML, QWeb and Webkit). The convention is to use a suffix to each module to indicate that it's for using with that report engine (for example, account_invoice_report_birt or sale_order_report_pentaho). It can contain also another utilities directly involved with reports (like merge/split utils, checkers, signing tools and so on). + + + +[//]: # (addons) + +This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools. + +[//]: # (end addons) + + + +## Licenses + +This repository is licensed under [AGPL-3.0](LICENSE). + +However, each module can have a totally different license, as long as they adhere to OCA +policy. Consult each module's `__manifest__.py` file, which contains a `license` key +that explains its license. ---- -OCA, or the Odoo Community Association, is a nonprofit organization whose -mission is to support the collaborative development of Odoo features and -promote its widespread use. - -https://odoo-community.org/ +OCA, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit +organization whose mission is to support the collaborative development of Odoo features +and promote its widespread use. diff --git a/kpi/__manifest__.py b/kpi/__manifest__.py index 3a9e48058..8dce77bd2 100644 --- a/kpi/__manifest__.py +++ b/kpi/__manifest__.py @@ -5,7 +5,7 @@ "name": "Key Performance Indicator", "version": "13.0.1.0.0", "author": "Savoir-faire Linux,Odoo Community Association (OCA)", - "website": "http://www.savoirfairelinux.com", + "website": "https://github.com/OCA/reporting-engine", "license": "AGPL-3", "category": "Report", "depends": ["base_external_dbsource"], diff --git a/report_csv/__manifest__.py b/report_csv/__manifest__.py index 76e7bc8a0..59ac82bc7 100644 --- a/report_csv/__manifest__.py +++ b/report_csv/__manifest__.py @@ -4,11 +4,10 @@ "name": "Base report csv", "summary": "Base module to create csv report", "author": "Creu Blanca, Odoo Community Association (OCA)", - "website": "https://github.com/oca/reporting-engine", + "website": "https://github.com/OCA/reporting-engine", "category": "Reporting", "version": "13.0.1.0.1", "license": "AGPL-3", - "external_dependencies": {"python": ["csv"]}, "depends": ["base", "web"], "data": ["views/webclient_templates.xml"], "demo": ["demo/report.xml"], diff --git a/report_layout_config/__manifest__.py b/report_layout_config/__manifest__.py index 3d5e7cc26..1fac33aef 100644 --- a/report_layout_config/__manifest__.py +++ b/report_layout_config/__manifest__.py @@ -6,7 +6,7 @@ "summary": "Add possibility to easily modify the global report layout", "version": "13.0.1.0.0", "category": "Reporting", - "website": "http://github.com/OCA/reporting-engine", + "website": "https://github.com/OCA/reporting-engine", "author": "Camptocamp, " "Odoo Community Association (OCA)", "license": "AGPL-3", "depends": ["web", "base"], diff --git a/report_py3o/__manifest__.py b/report_py3o/__manifest__.py index 7d272ed72..d21446f1b 100644 --- a/report_py3o/__manifest__.py +++ b/report_py3o/__manifest__.py @@ -8,7 +8,7 @@ "category": "Reporting", "license": "AGPL-3", "author": "XCG Consulting," "ACSONE SA/NV," "Odoo Community Association (OCA)", - "website": "http://odoo.consulting/", + "website": "https://github.com/OCA/reporting-engine", "depends": ["web"], "external_dependencies": {"python": ["py3o.template", "py3o.formats", "PyPDF2"]}, "data": [ diff --git a/report_qweb_element_page_visibility/__manifest__.py b/report_qweb_element_page_visibility/__manifest__.py index 81cc6ccf3..088b183a1 100644 --- a/report_qweb_element_page_visibility/__manifest__.py +++ b/report_qweb_element_page_visibility/__manifest__.py @@ -6,7 +6,7 @@ "version": "13.0.1.0.0", "author": "Agile Business Group, Odoo Community Association (OCA)", "category": "Tools", - "website": "https://github.com/oca/reporting-engine", + "website": "https://github.com/OCA/reporting-engine", "license": "AGPL-3", "application": False, "installable": True, diff --git a/report_qweb_parameter/__manifest__.py b/report_qweb_parameter/__manifest__.py index e7f9cb342..c266a8320 100644 --- a/report_qweb_parameter/__manifest__.py +++ b/report_qweb_parameter/__manifest__.py @@ -10,7 +10,7 @@ and check minimal length """, "author": "Creu Blanca, Odoo Community Association (OCA)", - "website": "https://github.com/oca/reporting-engine", + "website": "https://github.com/OCA/reporting-engine", "category": "Technical Settings", "depends": ["web"], "demo": ["demo/test_report_field_length.xml"], diff --git a/report_qweb_pdf_watermark/__manifest__.py b/report_qweb_pdf_watermark/__manifest__.py index f282f2603..16b8d5903 100644 --- a/report_qweb_pdf_watermark/__manifest__.py +++ b/report_qweb_pdf_watermark/__manifest__.py @@ -7,7 +7,7 @@ "license": "AGPL-3", "category": "Technical Settings", "summary": "Add watermarks to your QWEB PDF reports", - "website": "https://github.com/oca/reporting-engine", + "website": "https://github.com/OCA/reporting-engine", "depends": ["web"], "data": [ "demo/report.xml", diff --git a/report_qweb_signer/__manifest__.py b/report_qweb_signer/__manifest__.py index ce2ad41b1..4627d3501 100644 --- a/report_qweb_signer/__manifest__.py +++ b/report_qweb_signer/__manifest__.py @@ -8,7 +8,7 @@ "summary": "Sign Qweb PDFs usign a PKCS#12 certificate", "version": "13.0.1.0.0", "category": "Reporting", - "website": "https://github.com/oca/reporting-engine", + "website": "https://github.com/OCA/reporting-engine", "author": "Tecnativa, " "Odoo Community Association (OCA)", "license": "AGPL-3", "installable": True, diff --git a/report_xlsx/__manifest__.py b/report_xlsx/__manifest__.py index 8a6e265d5..378652375 100644 --- a/report_xlsx/__manifest__.py +++ b/report_xlsx/__manifest__.py @@ -4,7 +4,7 @@ "name": "Base report xlsx", "summary": "Base module to create xlsx report", "author": "ACSONE SA/NV," "Creu Blanca," "Odoo Community Association (OCA)", - "website": "https://github.com/oca/reporting-engine", + "website": "https://github.com/OCA/reporting-engine", "category": "Reporting", "version": "13.0.1.0.3", "development_status": "Production/Stable",