diff --git a/.copier-answers.yml b/.copier-answers.yml index 8bca5786..d0e94d10 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,8 +1,8 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.14.2 +_commit: v1.19.2 _src_path: gh:oca/oca-addons-repo-template -ci: Travis -dependency_installation_mode: PIP +ci: GitHub +convert_readme_fragments_to_markdown: false generate_requirements_txt: true github_check_license: true github_ci_extra_env: {} @@ -11,6 +11,7 @@ github_enable_makepot: true github_enable_stale_action: true github_enforce_dev_status_compatibility: true include_wkhtmltopdf: false +odoo_test_flavor: Both odoo_version: 14.0 org_name: Odoo Community Association (OCA) org_slug: OCA @@ -19,6 +20,6 @@ repo_description: Addons for Fleet management repo_name: Fleet repo_slug: fleet repo_website: https://github.com/OCA/fleet -travis_apt_packages: [] -travis_apt_sources: [] +use_pyproject_toml: false +use_ruff: false diff --git a/.eslintrc.yml b/.eslintrc.yml index 9429bc68..fed88d70 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -22,6 +22,7 @@ globals: odoo: readonly openerp: readonly owl: readonly + luxon: 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/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 755f8a22..602ecbca 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -13,8 +13,10 @@ jobs: pre-commit: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v2 + with: + python-version: "3.11" - name: Get python version run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - uses: actions/cache@v1 @@ -25,6 +27,15 @@ jobs: run: pip install pre-commit - name: Run pre-commit run: pre-commit run --all-files --show-diff-on-failure --color=always + env: + # Consider valid a PR that changes README fragments but doesn't + # change the README.rst file itself. It's not really a problem + # because the bot will update it anyway after merge. This way, we + # lower the barrier for functional contributors that want to fix the + # readme fragments, while still letting developers get README + # auto-generated (which also helps functionals when using runboat). + # DOCS https://pre-commit.com/#temporarily-disabling-hooks + SKIP: oca-gen-addon-readme - name: Check that all files generated by pre-commit are in git run: | newfiles="$(git ls-files --others --exclude-from=.gitignore)" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..326c1255 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,69 @@ +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@v3 + - 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 + name: test with Odoo + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest + name: test with OCB + makepot: "true" + services: + postgres: + image: postgres:9.6 + env: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoo + POSTGRES_DB: odoo + ports: + - 5432:5432 + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Install addons and dependencies + 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/.gitignore b/.gitignore index 9c283fd4..0090721f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ __pycache__/ *.py[cod] /.venv /.pytest_cache +/.ruff_cache # C extensions *.so diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 73fa37ee..fe726378 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,10 @@ exclude: | /static/(src/)?lib/| # Repos using Sphinx to generate docs don't need prettying ^docs/_templates/.*\.html$| + # Don't bother non-technical authors with formatting issues in docs + readme/.*\.(rst|md)$| + # Ignore build and dist directories in addons + /build/|/dist/| # You don't usually want a bot to modify your legal texts (LICENSE.*|COPYING.*) default_language_version: @@ -33,12 +37,25 @@ repos: language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/oca/maintainer-tools - rev: ab1d7f6 + rev: f71041f22b8cd68cf7c77b73a14ca8d8cd190a60 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/fleet"] + - id: oca-gen-addon-readme + args: + - --addons-dir=. + - --branch=14.0 + - --org-name=OCA + - --repo-name=fleet + - --if-source-changed + - --keep-source-digest + - repo: https://github.com/OCA/odoo-pre-commit-hooks + rev: v0.0.25 + hooks: + - id: oca-checks-odoo-module + - id: oca-checks-po - repo: https://github.com/myint/autoflake rev: v1.4 hooks: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5e8e3a66..00000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +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: - - test - -jobs: - include: - - stage: test - env: - - TESTS=1 ODOO_REPO="odoo/odoo" MAKEPOT="1" - - stage: test - env: - - TESTS=1 ODOO_REPO="OCA/OCB" -env: - global: - - VERSION="14.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" - - 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} - - travis_install_nightly - -script: - - travis_run_tests - -after_success: - - travis_after_tests_success diff --git a/README.md b/README.md index 52a0b9ea..dab5626f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/fleet&target_branch=14.0) -[![Build Status](https://travis-ci.com/OCA/fleet.svg?branch=14.0)](https://travis-ci.com/OCA/fleet) +[![Pre-commit Status](https://github.com/OCA/fleet/actions/workflows/pre-commit.yml/badge.svg?branch=14.0)](https://github.com/OCA/fleet/actions/workflows/pre-commit.yml?query=branch%3A14.0) +[![Build Status](https://github.com/OCA/fleet/actions/workflows/test.yml/badge.svg?branch=14.0)](https://github.com/OCA/fleet/actions/workflows/test.yml?query=branch%3A14.0) [![codecov](https://codecov.io/gh/OCA/fleet/branch/14.0/graph/badge.svg)](https://codecov.io/gh/OCA/fleet) [![Translation Status](https://translation.odoo-community.org/widgets/fleet-14-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/fleet-14-0/?utm_source=widget) diff --git a/fleet_vehicle_category/views/fleet_vehicle_views.xml b/fleet_vehicle_category/views/fleet_vehicle_views.xml index 5c7bd9f9..f31e3aa3 100644 --- a/fleet_vehicle_category/views/fleet_vehicle_views.xml +++ b/fleet_vehicle_category/views/fleet_vehicle_views.xml @@ -43,7 +43,7 @@ fleet.vehicle.category.tree fleet.vehicle.category - + diff --git a/fleet_vehicle_inspection/data/fleet_vehicle_inspection.xml b/fleet_vehicle_inspection/data/fleet_vehicle_inspection.xml index b33bf2b1..b474e1bf 100644 --- a/fleet_vehicle_inspection/data/fleet_vehicle_inspection.xml +++ b/fleet_vehicle_inspection/data/fleet_vehicle_inspection.xml @@ -1,21 +1,19 @@ - - - - - Fleet Vehicle Inspection Out - fleet.vehicle.inspection.out - FVI/OUT/ - 5 - - - - - Fleet Vehicle Inspection In - fleet.vehicle.inspection.in - FVI/IN/ - 5 - - - + + + + Fleet Vehicle Inspection Out + fleet.vehicle.inspection.out + FVI/OUT/ + 5 + + + + + Fleet Vehicle Inspection In + fleet.vehicle.inspection.in + FVI/IN/ + 5 + + diff --git a/fleet_vehicle_inspection/views/fleet_vehicle_inspection.xml b/fleet_vehicle_inspection/views/fleet_vehicle_inspection.xml index 0e3f066d..5b15410b 100644 --- a/fleet_vehicle_inspection/views/fleet_vehicle_inspection.xml +++ b/fleet_vehicle_inspection/views/fleet_vehicle_inspection.xml @@ -73,7 +73,7 @@ mode="tree,kanban" context="{'default_inspection_id': active_id}" > - + diff --git a/fleet_vehicle_inspection_template/views/fleet_vehicle_inspection_template.xml b/fleet_vehicle_inspection_template/views/fleet_vehicle_inspection_template.xml index 064dc650..9c515f50 100644 --- a/fleet_vehicle_inspection_template/views/fleet_vehicle_inspection_template.xml +++ b/fleet_vehicle_inspection_template/views/fleet_vehicle_inspection_template.xml @@ -26,10 +26,7 @@ name="inspection_template_lines" > - + diff --git a/fleet_vehicle_log_fuel/security/fleet_security.xml b/fleet_vehicle_log_fuel/security/fleet_security.xml index d4696b7b..3a57e225 100644 --- a/fleet_vehicle_log_fuel/security/fleet_security.xml +++ b/fleet_vehicle_log_fuel/security/fleet_security.xml @@ -1,24 +1,20 @@ - - - - User can only see his/her vehicle's fuel log - - - - - - - [('vehicle_id.driver_id','=',user.partner_id.id)] - - - Administrator has all rights on vehicle's fuel log - - - - + + + User can only see his/her vehicle's fuel log + + + + + + + [('vehicle_id.driver_id','=',user.partner_id.id)] + + + Administrator has all rights on vehicle's fuel log + + + diff --git a/fleet_vehicle_log_fuel/views/fleet_vehicle_cost_views.xml b/fleet_vehicle_log_fuel/views/fleet_vehicle_cost_views.xml index 910bd927..9df3ff4b 100644 --- a/fleet_vehicle_log_fuel/views/fleet_vehicle_cost_views.xml +++ b/fleet_vehicle_log_fuel/views/fleet_vehicle_cost_views.xml @@ -62,7 +62,7 @@ fleet.vehicle.log.fuel.tree fleet.vehicle.log.fuel - +