Skip to content

Commit 80bb9f8

Browse files
authored
Merge branch 'OCA:16.0' into 16.0
2 parents aa4faca + ec09c12 commit 80bb9f8

File tree

188 files changed

+6085
-873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+6085
-873
lines changed

.copier-answers.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Do NOT update manually; changes here will be overwritten by Copier
2-
_commit: v1.14.2
2+
_commit: v1.29
33
_src_path: gh:oca/oca-addons-repo-template
4+
additional_ruff_rules: []
45
ci: GitHub
5-
dependency_installation_mode: PIP
6+
convert_readme_fragments_to_markdown: true
7+
enable_checklog_odoo: false
68
generate_requirements_txt: true
79
github_check_license: true
810
github_ci_extra_env: {}
@@ -11,14 +13,21 @@ github_enable_makepot: false
1113
github_enable_stale_action: false
1214
github_enforce_dev_status_compatibility: true
1315
include_wkhtmltopdf: false
16+
odoo_test_flavor: Odoo
1417
odoo_version: 16.0
1518
org_name: Odoo Community Association (OCA)
1619
org_slug: OCA
1720
rebel_module_groups: []
18-
repo_description: null
19-
repo_name: 'Open Source upgrade path for Odoo/OpenERP '
20-
repo_slug: openupgrade
21+
repo_description: 'This <a href="https://odoo-community.org">OCA</a> project aims
22+
to provide an Open Source upgrade path for <a href="https://github.com/odoo/odoo">Odoo</a>
23+
from one major Odoo version to the next one.
24+
25+
It is hosted at <a href="https://github.com/oca/openupgrade">GitHub</a>.
26+
27+
For documentation, see <a href="https://oca.github.io/OpenUpgrade">here</a>.'
28+
repo_name: Tools to upgrade Odoo instances from a major version to another
29+
repo_slug: OpenUpgrade
2130
repo_website: https://github.com/OCA/OpenUpgrade
22-
travis_apt_packages: []
23-
travis_apt_sources: []
31+
use_pyproject_toml: true
32+
use_ruff: true
2433

.eslintrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ globals:
2222
odoo: readonly
2323
openerp: readonly
2424
owl: readonly
25+
luxon: readonly
2526

2627
# Styling is handled by Prettier, so we only need to enable AST rules;
2728
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890

.flake8

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/documentation-commit.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ jobs:
5252
unixodbc-dev
5353
- name: Requirements Installation
5454
run: |
55+
sed -i -E "s/(gevent==)21\.8\.0( ; sys_platform != 'win32' and python_version > '3.9' and python_version <= '3.10')/\122.10.2\2/;s/(greenlet==)1.1.2( ; sys_platform != 'win32' and python_version > '3.9' and python_version <= '3.10')/\12.0.2\2/" odoo/requirements.txt
5556
pip install -q -r odoo/requirements.txt
5657
pip install -r ./requirements.txt
5758
- name: OpenUpgrade Docs
5859
run: |
5960
# try to build the documentation
6061
sh ./build_openupgrade_docs
6162
- name: Commit changes
62-
uses: EndBug/add-and-commit@v9
63+
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 #v9
6364
with:
6465
add: "docs"
6566
default_author: github_actions

.github/workflows/pre-commit.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,29 @@ jobs:
1313
pre-commit:
1414
runs-on: ubuntu-22.04
1515
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-python@v2
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
1818
with:
1919
python-version: "3.11"
2020
- name: Get python version
2121
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
22-
- uses: actions/cache@v1
22+
- uses: actions/cache@v4
2323
with:
2424
path: ~/.cache/pre-commit
2525
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
2626
- name: Install pre-commit
2727
run: pip install pre-commit
2828
- name: Run pre-commit
2929
run: pre-commit run --all-files --show-diff-on-failure --color=always
30+
env:
31+
# Consider valid a PR that changes README fragments but doesn't
32+
# change the README.rst file itself. It's not really a problem
33+
# because the bot will update it anyway after merge. This way, we
34+
# lower the barrier for functional contributors that want to fix the
35+
# readme fragments, while still letting developers get README
36+
# auto-generated (which also helps functionals when using runboat).
37+
# DOCS https://pre-commit.com/#temporarily-disabling-hooks
38+
SKIP: oca-gen-addon-readme
3039
- name: Check that all files generated by pre-commit are in git
3140
run: |
3241
newfiles="$(git ls-files --others --exclude-from=.gitignore)"

.github/workflows/test.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
test:
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-22.04
1616
env:
1717
DB: "openupgrade"
1818
DB_HOST: "localhost"
@@ -25,42 +25,43 @@ jobs:
2525
PGPASSWORD: "odoo"
2626
PGUSER: "odoo"
2727
OPENUPGRADE_USE_DEMO: "yes"
28+
services:
29+
postgres:
30+
image: postgres:14.0
31+
env:
32+
POSTGRES_USER: odoo
33+
POSTGRES_PASSWORD: odoo
34+
POSTGRES_DB: odoo
35+
ports:
36+
- 5432:5432
2837
steps:
2938
- name: Set up Python
30-
uses: actions/setup-python@v4
39+
uses: actions/setup-python@v5
3140
with:
3241
python-version: '3.10'
33-
- name: Configure Postgres
34-
uses: harmon758/postgresql-action@v1
35-
with:
36-
postgresql version: "14"
37-
postgresql user: ${DB_USERNAME}
38-
postgresql password: ${DB_PASSWORD}
39-
- name: Wait / Sleep
40-
uses: jakejarvis/wait-action@v0.1.0
41-
with:
42-
time: "10s"
42+
- name: Sleep for 10 seconds
43+
run: sleep 10s
4344
- name: DB Creation
4445
run: createdb $DB
4546
- name: DB Restore
4647
run: |
4748
wget -q -O- $DOWNLOADS/15.0.psql | pg_restore -d $DB --no-owner
4849
- name: Check out Odoo
49-
uses: actions/checkout@v2
50+
uses: actions/checkout@v4
5051
with:
5152
repository: odoo/odoo
5253
ref: "16.0"
5354
fetch-depth: 1
5455
path: odoo
5556
- name: Check out previous Odoo
56-
uses: actions/checkout@v2
57+
uses: actions/checkout@v4
5758
with:
5859
repository: odoo/odoo
5960
ref: "15.0"
6061
fetch-depth: 1
6162
path: odoo-old
6263
- name: Check out OpenUpgrade
63-
uses: actions/checkout@v2
64+
uses: actions/checkout@v4
6465
with:
6566
path: openupgrade
6667
- name: Configuration
@@ -85,6 +86,7 @@ jobs:
8586
unixodbc-dev
8687
- name: Requirements Installation
8788
run: |
89+
sed -i -E "s/(gevent==)21\.8\.0( ; sys_platform != 'win32' and python_version > '3.9' and python_version <= '3.10')/\122.10.2\2/;s/(greenlet==)1.1.2( ; sys_platform != 'win32' and python_version > '3.9' and python_version <= '3.10')/\12.0.2\2/" odoo/requirements.txt
8890
pip install -q -r odoo/requirements.txt
8991
pip install -r ./openupgrade/requirements.txt
9092
# this is for v15 l10n_eg_edi_eta which crashes without it
@@ -94,6 +96,12 @@ jobs:
9496
for snippet in openupgrade/openupgrade_scripts/scripts/*/*/tests/data*.py; do
9597
odoo-old/odoo-bin shell -d $DB < $snippet
9698
done
99+
- name: Test end-migration script for newly installed module (i.e. "spreadsheet" for v16)
100+
run: |
101+
END_SCRIPT_TEST=openupgrade/openupgrade_scripts/scripts/base/16.0.1.3/tests/end-migration_test.py
102+
NEW_MODULE_SCRIPT_DIR=openupgrade/openupgrade_scripts/scripts/spreadsheet/16.0.1.0/
103+
mkdir -p $NEW_MODULE_SCRIPT_DIR
104+
cp $END_SCRIPT_TEST $NEW_MODULE_SCRIPT_DIR
97105
- name: OpenUpgrade test
98106
run: |
99107
# select modules and perform the upgrade

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ __pycache__/
33
*.py[cod]
44
/.venv
55
/.pytest_cache
6+
/.ruff_cache
67

78
# C extensions
89
*.so
@@ -24,6 +25,19 @@ var/
2425
*.egg
2526
*.eggs
2627

28+
# Windows installers
29+
*.msi
30+
31+
# Debian packages
32+
*.deb
33+
34+
# Redhat packages
35+
*.rpm
36+
37+
# MacOS packages
38+
*.dmg
39+
*.pkg
40+
2741
# Installer logs
2842
pip-log.txt
2943
pip-delete-this-directory.txt

.isort.cfg

Lines changed: 0 additions & 13 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 51 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ exclude: |
55
# Files and folders generated by bots, to avoid loops
66
^setup/|/static/description/index\.html$|
77
# We don't want to mess with tool-generated files
8-
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
8+
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs|
99
# Maybe reactivate this when all README files include prettier ignore tags?
1010
^README\.md$|
1111
# Library files can have extraneous formatting (even minimized)
1212
/static/(src/)?lib/|
1313
# Repos using Sphinx to generate docs don't need prettying
1414
^docs/_templates/.*\.html$|
15+
# Don't bother non-technical authors with formatting issues in docs
16+
readme/.*\.(rst|md)$|
17+
# Ignore build and dist directories in addons
18+
/build/|/dist/|
19+
# Ignore test files in addons
20+
/tests/samples/.*|
1521
# You don't usually want a bot to modify your legal texts
1622
(LICENSE.*|COPYING.*)
1723
default_language_version:
@@ -32,47 +38,63 @@ repos:
3238
entry: found a en.po file
3339
language: fail
3440
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
41+
- repo: https://github.com/sbidoul/whool
42+
rev: v1.2
43+
hooks:
44+
- id: whool-init
3545
- repo: https://github.com/oca/maintainer-tools
36-
rev: 4cd2b852214dead80822e93e6749b16f2785b2fe
46+
rev: d5fab7ee87fceee858a3d01048c78a548974d935
3747
hooks:
3848
# update the NOT INSTALLABLE ADDONS section above
3949
- id: oca-update-pre-commit-excluded-addons
4050
- id: oca-fix-manifest-website
4151
args: ["https://github.com/OCA/OpenUpgrade"]
42-
- repo: https://github.com/myint/autoflake
43-
rev: v1.6.1
44-
hooks:
45-
- id: autoflake
52+
- id: oca-gen-addon-readme
4653
args:
47-
- --expand-star-imports
48-
- --ignore-init-module-imports
49-
- --in-place
50-
- --remove-all-unused-imports
51-
- --remove-duplicate-keys
52-
- --remove-unused-variables
53-
- repo: https://github.com/psf/black
54-
rev: 22.8.0
54+
- --addons-dir=.
55+
- --branch=16.0
56+
- --org-name=OCA
57+
- --repo-name=OpenUpgrade
58+
- --if-source-changed
59+
- --keep-source-digest
60+
- --convert-fragments-to-markdown
61+
- id: oca-gen-external-dependencies
62+
- repo: https://github.com/OCA/odoo-pre-commit-hooks
63+
rev: v0.0.25
5564
hooks:
56-
- id: black
57-
- repo: https://github.com/pre-commit/mirrors-prettier
58-
rev: v2.7.1
65+
- id: oca-checks-odoo-module
66+
- id: oca-checks-po
67+
args:
68+
- --disable=po-pretty-format
69+
- repo: local
5970
hooks:
6071
- id: prettier
6172
name: prettier (with plugin-xml)
73+
entry: prettier
74+
args:
75+
- --write
76+
- --list-different
77+
- --ignore-unknown
78+
types: [text]
79+
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
80+
language: node
6281
additional_dependencies:
6382
- "prettier@2.7.1"
6483
- "@prettier/plugin-xml@2.2.0"
65-
args:
66-
- --plugin=@prettier/plugin-xml
67-
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
68-
- repo: https://github.com/pre-commit/mirrors-eslint
69-
rev: v8.24.0
84+
- repo: local
7085
hooks:
7186
- id: eslint
72-
verbose: true
87+
name: eslint
88+
entry: eslint
7389
args:
7490
- --color
7591
- --fix
92+
verbose: true
93+
types: [javascript]
94+
language: node
95+
additional_dependencies:
96+
- "eslint@8.24.0"
97+
- "eslint-plugin-jsdoc@"
7698
- repo: https://github.com/pre-commit/pre-commit-hooks
7799
rev: v4.3.0
78100
hooks:
@@ -95,31 +117,14 @@ repos:
95117
- id: check-xml
96118
- id: mixed-line-ending
97119
args: ["--fix=lf"]
98-
- repo: https://github.com/asottile/pyupgrade
99-
rev: v2.38.2
100-
hooks:
101-
- id: pyupgrade
102-
args: ["--keep-percent-format"]
103-
- repo: https://github.com/PyCQA/isort
104-
rev: 5.12.0
105-
hooks:
106-
- id: isort
107-
name: isort except __init__.py
108-
args:
109-
- --settings=.
110-
exclude: /__init__\.py$
111-
- repo: https://github.com/acsone/setuptools-odoo
112-
rev: 3.1.8
113-
hooks:
114-
- id: setuptools-odoo-make-default
115-
- repo: https://github.com/PyCQA/flake8
116-
rev: 3.9.2
120+
- repo: https://github.com/astral-sh/ruff-pre-commit
121+
rev: v0.1.3
117122
hooks:
118-
- id: flake8
119-
name: flake8
120-
additional_dependencies: ["flake8-bugbear==21.9.2"]
123+
- id: ruff
124+
args: [--fix, --exit-non-zero-on-fix]
125+
- id: ruff-format
121126
- repo: https://github.com/OCA/pylint-odoo
122-
rev: 7.0.2
127+
rev: v8.0.19
123128
hooks:
124129
- id: pylint_odoo
125130
name: pylint with optional checks

0 commit comments

Comments
 (0)