Skip to content

Commit 2751b51

Browse files
Merge PR #8 into 16.0
Signed-off-by legalsylvain
2 parents dec2237 + 7b10444 commit 2751b51

File tree

10 files changed

+64
-62
lines changed

10 files changed

+64
-62
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Do NOT update manually; changes here will be overwritten by Copier
2-
_commit: 352dc52
2+
_commit: 51c8c81
33
_src_path: https://github.com/grap/oca-addons-repo-template-v16
44
additional_ruff_rules: []
55
ci: GitHub

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- uses: actions/setup-python@v5
1818
with:
1919
python-version: "3.11"
20+
cache: 'pip'
2021
- name: Get python version
2122
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
2223
- uses: actions/cache@v4

.github/workflows/test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ jobs:
4545
run: oca_init_test_database
4646
- name: Run tests
4747
run: oca_run_tests
48+
- name: Upload screenshots from JS tests
49+
uses: actions/upload-artifact@v4
50+
if: ${{ failure() }}
51+
with:
52+
name: Screenshots of failed JS tests - ${{ matrix.name }}${{ join(matrix.include) }}
53+
path: /tmp/odoo_tests/${{ env.PGDATABASE }}
54+
if-no-files-found: ignore
4855
- uses: codecov/codecov-action@v4
4956
with:
5057
token: ${{ secrets.CODECOV_TOKEN }}

.pre-commit-config.yaml

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -62,36 +62,6 @@ repos:
6262
- id: oca-checks-po
6363
args:
6464
- --disable=po-pretty-format
65-
- repo: https://github.com/myint/autoflake
66-
rev: v1.6.1
67-
hooks:
68-
- id: autoflake
69-
args:
70-
- --expand-star-imports
71-
- --ignore-init-module-imports
72-
- --in-place
73-
- --remove-all-unused-imports
74-
- --remove-duplicate-keys
75-
- --remove-unused-variables
76-
- repo: https://github.com/psf/black
77-
rev: 22.8.0
78-
hooks:
79-
- id: black
80-
- repo: local
81-
hooks:
82-
- id: eslint
83-
name: eslint
84-
entry: eslint
85-
args:
86-
- --color
87-
- --fix
88-
verbose: true
89-
types: [javascript]
90-
language: node
91-
additional_dependencies:
92-
- "eslint@8.24.0"
93-
- "eslint-plugin-jsdoc@"
94-
- "globals@"
9565
- repo: https://github.com/pre-commit/pre-commit-hooks
9666
rev: v4.3.0
9767
hooks:
@@ -114,21 +84,8 @@ repos:
11484
- id: check-xml
11585
- id: mixed-line-ending
11686
args: ["--fix=lf"]
117-
- repo: https://github.com/asottile/pyupgrade
118-
rev: v2.38.2
119-
hooks:
120-
- id: pyupgrade
121-
args: ["--keep-percent-format"]
122-
- repo: https://github.com/PyCQA/isort
123-
rev: 5.12.0
124-
hooks:
125-
- id: isort
126-
name: isort except __init__.py
127-
args:
128-
- --settings=.
129-
exclude: /__init__\.py$
13087
- repo: https://github.com/acsone/setuptools-odoo
131-
rev: 3.1.8
88+
rev: 3.3.2
13289
hooks:
13390
- id: setuptools-odoo-make-default
13491
- id: setuptools-odoo-get-requirements
@@ -137,12 +94,12 @@ repos:
13794
- requirements.txt
13895
- --header
13996
- "# generated from manifests external_dependencies"
140-
- repo: https://github.com/PyCQA/flake8
141-
rev: 5.0.0
97+
- repo: https://github.com/astral-sh/ruff-pre-commit
98+
rev: v0.1.3
14299
hooks:
143-
- id: flake8
144-
name: flake8
145-
additional_dependencies: ["flake8-bugbear==21.9.2"]
100+
- id: ruff
101+
args: [--fix, --exit-non-zero-on-fix]
102+
- id: ruff-format
146103
- repo: https://github.com/OCA/pylint-odoo
147104
rev: v8.0.19
148105
hooks:

.pylintrc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,22 @@ enable=anomalous-backslash-in-string,
9999
translation-positional-used,
100100
website-manifest-key-not-valid-uri,
101101
external-request-timeout,
102-
# messages that do not cause the lint step to fail
103-
consider-merging-classes-inherited,
102+
missing-manifest-dependency,
103+
too-complex,,
104104
create-user-wo-reset-password,
105105
dangerous-filter-wo-user,
106-
deprecated-module,
107106
file-not-used,
108-
invalid-commit,
109-
missing-manifest-dependency,
110107
missing-newline-extrafiles,
111-
missing-readme,
112108
no-utf8-coding-comment,
113-
odoo-addons-relative-import,
114109
old-api7-method-defined,
115-
redefined-builtin,
116-
too-complex,
117110
unnecessary-utf8-coding-comment,
111+
# messages that do not cause the lint step to fail
112+
consider-merging-classes-inherited,
113+
deprecated-module,
114+
invalid-commit,
115+
missing-readme,
116+
odoo-addons-relative-import,
117+
redefined-builtin,
118118
manifest-external-assets
119119

120120

.ruff.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
target-version = "py310"
3+
fix = true
4+
5+
[lint]
6+
extend-select = [
7+
"B",
8+
"C90",
9+
"E501", # line too long (default 88)
10+
"I", # isort
11+
"UP", # pyupgrade
12+
]
13+
extend-safe-fixes = ["UP008"]
14+
exclude = ["setup/*"]
15+
16+
[format]
17+
exclude = ["setup/*"]
18+
19+
[per-file-ignores]
20+
"__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py
21+
"__manifest__.py" = ["B018"] # useless expression
22+
23+
[isort]
24+
section-order = ["future", "standard-library", "third-party", "odoo", "odoo-addons", "first-party", "local-folder"]
25+
26+
[isort.sections]
27+
"odoo" = ["odoo"]
28+
"odoo-addons" = ["odoo.addons"]
29+
30+
[mccabe]
31+
max-complexity = 16

fermente_custom_import_account_product_fiscal_classification/models/custom_import_product_mixin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def _custom_import_handle_fiscal_classification_id(self, old_vals, new_vals):
6161
else:
6262
raise ValidationError(
6363
_(
64-
"Many Fiscal Classifications Found for the product %(product_name)s."
64+
"Many Fiscal Classifications Found"
65+
" for the product %(product_name)s."
6566
" Vat Amount %(vat_amount)s."
6667
" Fiscal Classifications : %(classification_names)s",
6768
product_name=old_vals.get("name"),

fermente_custom_import_demo/models/product_template.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ def get_import_templates(self):
1313
return [
1414
{
1515
"label": _("Import Template for Fermente CAE"),
16-
"template": "fermente_custom_import_product/static/xlsx/template_product.xlsx",
16+
"template": (
17+
"fermente_custom_import_product/"
18+
"static/xlsx/template_product.xlsx"
19+
),
1720
}
1821
]

fermente_custom_import_partner_firstname/models/custom_import_partner_mixin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def _custom_import_hook_check(self, vals_list):
2727
if (vals.get("firstname") or vals.get("lastname")) and vals.get("name"):
2828
raise ValidationError(
2929
_(
30-
"The file contains contacts that has first name or last name AND"
30+
"The file contains contacts that"
31+
" has first name or last name AND"
3132
" name fields defined. Please set a name for a company"
3233
" or a first name / last name for an individual."
3334
" First Name: %(firstname)s ; "

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# generated from manifests external_dependencies

0 commit comments

Comments
 (0)