From 2c45c8704686813f1f72eeb5e2e1610776c19b2c Mon Sep 17 00:00:00 2001 From: Carlos Dauden Date: Thu, 12 Nov 2026 16:14:51 +0100 Subject: [PATCH 1/2] [IMP] update dotfiles Update the oca-addons-repo-template to v1.49. On 20.0 ruff ignores RUF012 (mutable-class-default), like Odoo core does, so `_inherit` lists pass ruff 0.16 without `# noqa`. It also hardens the GitHub workflows. --- .copier-answers.yml | 2 +- .github/workflows/pre-commit.yml | 11 ++++++++--- .github/workflows/stale.yml | 9 +++++++-- .github/workflows/test.yml | 24 ++++++++++++++++-------- .pre-commit-config.yaml | 3 +++ .ruff.toml | 3 +++ checklog-odoo.cfg | 2 ++ 7 files changed, 40 insertions(+), 14 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index cc53317263..6273516e73 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.45 +_commit: v1.49 _src_path: git+https://github.com/OCA/oca-addons-repo-template additional_ruff_rules: [] convert_readme_fragments_to_markdown: true diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index a4ee032014..8d1148c12a 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -14,19 +14,24 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: pre-commit: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.12" cache: 'pip' cache-dependency-path: '.pre-commit-config.yaml' - name: Get python version run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - - uses: actions/cache@v4 + - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ~/.cache/pre-commit key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index fa17fcd4e8..3b2e536808 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -4,12 +4,17 @@ on: schedule: - cron: "0 12 * * 0" +permissions: + contents: read + issues: write + pull-requests: write + jobs: stale: runs-on: ubuntu-latest steps: - name: Stale PRs and issues policy - uses: actions/stale@v9 + uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} # General settings. @@ -48,7 +53,7 @@ jobs: # * Issues that are pending more information # * Except Issues marked as "no stale" - name: Needs more information stale issues policy - uses: actions/stale@v9 + uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} ascending: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ade459d20f..12c0b3f044 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,12 +13,17 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: unreleased-deps: runs-on: ubuntu-latest name: Detect unreleased dependencies steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - run: | for reqfile in requirements.txt test-requirements.txt ; do if [ -f ${reqfile} ] ; then @@ -33,7 +38,7 @@ jobs: done test: runs-on: ubuntu-22.04 - container: ${{ matrix.container }} + container: ${{ matrix.container }} # zizmor: ignore[unpinned-images] name: ${{ matrix.name }} strategy: fail-fast: false @@ -54,9 +59,9 @@ jobs: ports: - 5432:5432 env: - OCA_ENABLE_CHECKLOG_ODOO: "1" + "OCA_ENABLE_CHECKLOG_ODOO": "1" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install addons and dependencies @@ -70,15 +75,18 @@ jobs: - name: Run tests run: oca_run_tests - name: Upload screenshots from JS tests - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 if: ${{ failure() }} with: name: Screenshots of failed JS tests - ${{ matrix.name }}${{ join(matrix.include) }} path: /tmp/odoo_tests/${{ env.PGDATABASE }} if-no-files-found: ignore - - uses: codecov/codecov-action@v4 + - uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: token: ${{ secrets.CODECOV_TOKEN }} - 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' }} + run: oca_export_and_push_pot "https://x-access-token:${GIT_PUSH_TOKEN}@github.com/${GITHUB_REPOSITORY}" + env: + GIT_PUSH_TOKEN: ${{ secrets.GIT_PUSH_TOKEN }} + if: matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cdbd3cf757..d238086d0b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -74,6 +74,9 @@ repos: - --keep-source-digest - --convert-fragments-to-markdown - id: oca-gen-external-dependencies + additional_dependencies: + # Odoo 20 is supported since manifestoo-core v1.16.0 + - manifestoo-core>=v1.16.1 - repo: https://github.com/OCA/odoo-pre-commit-hooks rev: v0.2.27 hooks: diff --git a/.ruff.toml b/.ruff.toml index 5e63128201..84d45ebd97 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -11,6 +11,9 @@ extend-select = [ "UP", # pyupgrade ] extend-safe-fixes = ["UP008"] +extend-ignore = [ + "RUF012", # mutable-class-default +] exclude = ["setup/*"] [format] diff --git a/checklog-odoo.cfg b/checklog-odoo.cfg index 58d43aa666..76227c0f4b 100644 --- a/checklog-odoo.cfg +++ b/checklog-odoo.cfg @@ -3,3 +3,5 @@ ignore= WARNING.* 0 failed, 0 error\(s\).* WARNING .* Killing chrome descendants-or-self .* WARNING.* Missing widget: res_partner_many2one for field of type many2one.* + (?ms)WARNING.* odoo.addons.base.models.assetsbundle: Error: argument `[$]color` of `rgba[(][$]color, [$]alpha[)]` must be a color.*odoo/addons/web/static/lib/bootstrap/scss/mixins/_buttons.scss, in mixin `button-outline-variant`.* + WARNING .* odoo.tools.config: option addons_path, invalid addons directory .*, skipped From 7ceb4e6ab744d1be631a99932e643397e7b1ac68 Mon Sep 17 00:00:00 2001 From: Carlos Dauden Date: Thu, 12 Nov 2026 16:15:05 +0100 Subject: [PATCH 2/2] [IMP] queue_job: pre-commit auto fixes --- queue_job/fields.py | 2 +- queue_job/models/queue_job.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/queue_job/fields.py b/queue_job/fields.py index e2fcbdfe4a..efd405cf41 100644 --- a/queue_job/fields.py +++ b/queue_job/fields.py @@ -30,7 +30,7 @@ class JobSerialized(fields.Json): _base_type = None # these are the default values when we convert an empty value - _default_json_mapping = { # noqa: RUF012 + _default_json_mapping = { dict: "{}", list: "[]", tuple: "[]", diff --git a/queue_job/models/queue_job.py b/queue_job/models/queue_job.py index cc5fbf9ebd..49923424fd 100644 --- a/queue_job/models/queue_job.py +++ b/queue_job/models/queue_job.py @@ -35,7 +35,7 @@ class QueueJob(models.Model): _name = "queue.job" _description = "Queue Job" - _inherit = ["mail.thread", "mail.activity.mixin"] # noqa: RUF012 + _inherit = ["mail.thread", "mail.activity.mixin"] _log_access = False _order = "date_created DESC, date_done DESC"