diff --git a/.copier-answers.yml b/.copier-answers.yml index 6dd0eaa273..7f8bd75d0b 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: git+https://github.com/OCA/oca-addons-repo-template ci: GitHub -dependency_installation_mode: PIP +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: OCB odoo_version: 12.0 org_name: Odoo Community Association (OCA) org_slug: OCA @@ -28,6 +29,4 @@ repo_description: 'Asynchronous Job Queue. Delay Model methods in asynchronous j repo_name: Odoo Queue Modules repo_slug: queue repo_website: https://github.com/OCA/queue -travis_apt_packages: [] -travis_apt_sources: [] diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index f86d418269..0c862ddae0 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -13,7 +13,7 @@ jobs: pre-commit: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v2 with: python-version: "3.6" @@ -27,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 index 20bf055d40..eff446b0ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest name: Detect unreleased dependencies steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | for reqfile in requirements.txt test-requirements.txt ; do if [ -f ${reqfile} ] ; then @@ -36,10 +36,10 @@ jobs: matrix: include: - container: ghcr.io/oca/oca-ci/py3.6-odoo12.0:latest - makepot: "true" name: test with Odoo - container: ghcr.io/oca/oca-ci/py3.6-ocb12.0:latest name: test with OCB + makepot: "true" services: postgres: image: postgres:9.6 @@ -50,7 +50,7 @@ jobs: ports: - 5432:5432 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: persist-credentials: false - name: Install addons and dependencies diff --git a/.gitignore b/.gitignore index 9c283fd41f..0090721f5d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ __pycache__/ *.py[cod] /.venv /.pytest_cache +/.ruff_cache # C extensions *.so diff --git a/queue_job/job.py b/queue_job/job.py index 9bd801f509..0f44969712 100644 --- a/queue_job/job.py +++ b/queue_job/job.py @@ -533,6 +533,7 @@ def enqueue_waiting(self): AND state = %s; """ self.env.cr.execute(sql, (PENDING, self.uuid, DONE, WAIT_DEPENDENCIES)) + self.env["queue.job"].invalidate_cache(["state"]) def store(self): """Store the Job""" diff --git a/queue_job/models/queue_job.py b/queue_job/models/queue_job.py index d13d1afbaf..ba3a3acfc4 100644 --- a/queue_job/models/queue_job.py +++ b/queue_job/models/queue_job.py @@ -102,7 +102,8 @@ class QueueJob(models.Model): index=True) priority = fields.Integer() exc_name = fields.Char(string="Exception", readonly=True) - exc_message = fields.Char(string="Exception Message", readonly=True) + exc_message = fields.Char(string="Exception Message", readonly=True, + track_visibility='onchange') exc_info = fields.Text(string='Exception Info', readonly=True) result = fields.Text(readonly=True) diff --git a/queue_job/tests/test_delayable.py b/queue_job/tests/test_delayable.py index b5fc86f0f8..394cbc5302 100644 --- a/queue_job/tests/test_delayable.py +++ b/queue_job/tests/test_delayable.py @@ -4,6 +4,8 @@ import mock import unittest +# pylint: disable=odoo-addons-relative-import +# we are testing, we want to test as we were an external consumer of the API from odoo.addons.queue_job.delay import Delayable, DelayableGraph