diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000..1747c79 --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,15 @@ +# Do NOT update manually; changes here will be overwritten by Copier +_commit: c26a26c +_src_path: gh:open-synergy/ssi-addons-repo-template +dependency_installation_mode: OCA +generate_requirements_txt: true +include_aeroo_report: false +include_wkhtmltopdf: false +odoo_version: 14.0 +rebel_module_groups: [] +repo_description: opnsynid-stock-reporting +repo_name: opnsynid-stock-reporting +repo_slug: opnsynid-stock-reporting +travis_apt_packages: [] +travis_apt_sources: [] + diff --git a/.eslintrc.yml b/.eslintrc.yml index 88f2881..16a185f 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 44ed868..638a9cd 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) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..3a6b6ed --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,18 @@ +name: pre-commit + +on: + pull_request: + push: + +jobs: + pre-commit: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - name: Get python version + run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV + - uses: actions/cache@v1 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..912a685 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,71 @@ +name: tests + +on: + pull_request: + branches: + - "14.0*" + push: + branches: + - "14.0" + - "14.0-ocabot-*" + +jobs: + unreleased-deps: + runs-on: ubuntu-latest + name: Detect unreleased dependencies + steps: + - uses: actions/checkout@v2 + - run: | + for reqfile in requirements.txt test-requirements.txt ; do + if [ -f ${reqfile} ] ; then + result=0 + # reject non-comment lines that contain a / (i.e. URLs, relative paths) + grep "^[^#].*/" ${reqfile} || result=$? + if [ $result -eq 0 ] ; then + echo "Unreleased dependencies found in ${reqfile}." + exit 1 + fi + fi + done + test: + runs-on: ubuntu-22.04 + container: ${{ matrix.container }} + name: ${{ matrix.name }} + strategy: + fail-fast: false + matrix: + include: + - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest + makepot: "true" + name: test with Odoo + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest + name: test with OCB + services: + postgres: + image: postgres:9.6 + env: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoo + POSTGRES_DB: odoo + ports: + - 5432:5432 + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + - name: Install addons and dependencies + env: + PIP_INDEX_URL: https://pypi.org/simple + run: oca_install_addons + - name: Check licenses + run: manifestoo -d . check-licenses + - name: Check development status + run: manifestoo -d . check-dev-status --default-dev-status=Beta + - name: Initialize test db + run: oca_init_test_database + - name: Run tests + run: oca_run_tests + - uses: codecov/codecov-action@v1 + - name: Update .pot files + run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }} + if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }} 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 3d431f2..923010c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,8 @@ exclude: | # 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$|^.github/| # Maybe reactivate this when all README files include prettier ignore tags? ^README\.md$| # Library files can have extraneous formatting (even minimized) @@ -26,7 +28,7 @@ repos: language: fail files: "\\.rej$" - repo: https://github.com/oca/maintainer-tools - rev: f2d1be9daceb2cccc102ae2be44891ce4a0ed3a0 + rev: ab1d7f6 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons @@ -36,21 +38,28 @@ repos: 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: @@ -85,6 +94,7 @@ repos: rev: v2.7.2 hooks: - id: pyupgrade + args: ["--keep-percent-format"] - repo: https://github.com/PyCQA/isort rev: 5.5.1 hooks: @@ -102,8 +112,8 @@ repos: - requirements.txt - --header - "# generated from manifests external_dependencies" - - repo: https://gitlab.com/PyCQA/flake8 - rev: 3.8.3 + - repo: https://github.com/PyCQA/flake8 + rev: 3.9.2 hooks: - id: flake8 name: flake8 except __init__.py @@ -124,7 +134,7 @@ repos: - --exit-zero verbose: true additional_dependencies: &pylint_deps - - ssi-pylint-odoo==3.5.0.dev2 + - pylint-odoo==3.5.0 - id: pylint name: pylint with mandatory checks args: diff --git a/.pylintrc b/.pylintrc index 9fc65da..f607ba1 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,5 +1,5 @@ [MASTER] -load-plugins=ssi_pylint_odoo +load-plugins=pylint_odoo score=n [ODOOLINT] @@ -64,7 +64,6 @@ enable=anomalous-backslash-in-string, use-vim-comment, wrong-tabs-instead-of-spaces, xml-syntax-error, - file-not-used, # messages that do not cause the lint step to fail consider-merging-classes-inherited, create-user-wo-reset-password, diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index b47a111..d5906aa 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -1,5 +1,5 @@ [MASTER] -load-plugins=ssi_pylint_odoo +load-plugins=pylint_odoo score=n [ODOOLINT] @@ -56,8 +56,7 @@ enable=anomalous-backslash-in-string, unreachable, use-vim-comment, wrong-tabs-instead-of-spaces, - xml-syntax-error, - file-not-used + xml-syntax-error [REPORTS] msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 95e0a61..0000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: python -cache: - directories: - - $HOME/.cache/pip - - $HOME/.cache/pre-commit - -python: - - "3.6" - -addons: - postgresql: "9.6" - apt: - packages: - - expect-dev # provides unbuffer utility - -stages: - - linting - - test - -jobs: - include: - - stage: linting - name: "pre-commit" - install: pip install pre-commit - script: pre-commit run --all --show-diff-on-failure --verbose --color always - after_success: - before_install: - - stage: test - env: - - TESTS=1 ODOO_REPO="odoo/odoo" MAKEPOT="1" -env: - global: - - VERSION="14.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" - - WKHTMLTOPDF_VERSION="0.12.5" - -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} - - travis_install_nightly - -script: - - travis_run_tests - -after_success: - - travis_after_tests_success diff --git a/README.md b/README.md index ec3f653..0b80c66 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ [![Build Status](https://travis-ci.com/open-synergy/opnsynid-stock-reporting.svg?branch=14.0)](https://travis-ci.com/open-synergy/opnsynid-stock-reporting) +![pre-commit](https://github.com/open-synergy/opnsynid-stock-reporting/actions/workflows/pre-commit.yml/badge.svg) [![codecov](https://codecov.io/gh/open-synergy/opnsynid-stock-reporting/branch/14.0/graph/badge.svg)](https://codecov.io/gh/open-synergy/opnsynid-stock-reporting) -# Mixin Object +# opnsynid-stock-reporting -Mixin Object Repository +opnsynid-stock-reporting @@ -23,13 +24,12 @@ This part will be replaced when running the oca-gen-addons-table script from OCA This repository is licensed under [AGPL-3.0](LICENSE). -However, each module can have a totally different license. Consult each module's `__manifest__.py` file, which contains a `license` key +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. ---- -.. image:: https://simetri-sinergi.id/logo.png - :alt: PT. Simetri Sinergi Indonesia - :target: https://simetri-sinergi.id.com - -This repo is maintained by the PT. Simetri Sinergi Indonesia. +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/stock_card_report_value/__manifest__.py b/stock_card_report_value/__manifest__.py index 28f0009..14bd182 100644 --- a/stock_card_report_value/__manifest__.py +++ b/stock_card_report_value/__manifest__.py @@ -4,7 +4,7 @@ # pylint: disable=locally-disabled, manifest-required-author { "name": "Stock Card Report Value", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "category": "Stock Management", "website": "https://simetri-sinergi.id", "author": "PT. Simetri Sinergi Indonesia, OpenSynergy Indonesia",