Skip to content

Commit 4d76d36

Browse files
committed
merge: resolve conflict with 19.0 (keep programId + modal target)
2 parents d143593 + 071686c commit 4d76d36

File tree

1,076 files changed

+43199
-28005
lines changed

Some content is hidden

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

1,076 files changed

+43199
-28005
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ jobs:
123123
needs: [detect-changes, build]
124124
if: needs.detect-changes.outputs.has_modules == 'true'
125125
runs-on: ubuntu-latest
126+
timeout-minutes: 15
126127
strategy:
127128
fail-fast: false
128129
matrix:
@@ -203,7 +204,6 @@ jobs:
203204
--db_user=odoo \
204205
--db_password=odoo \
205206
--stop-after-init \
206-
--no-http \
207207
--data-dir /tmp/odoo-data \
208208
-i ${{ matrix.module }} \
209209
--test-tags=/${{ matrix.module }} \

.github/workflows/security.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ jobs:
167167
--config p/python \
168168
--config p/security-audit \
169169
--config .semgrep/ \
170+
--exclude scripts/ \
170171
--sarif \
171172
--output semgrep-results.sarif \
172173
2>&1 || SEMGREP_EXIT=$?
@@ -176,10 +177,33 @@ jobs:
176177
--config p/python \
177178
--config p/security-audit \
178179
--config .semgrep/ \
180+
--exclude scripts/ \
179181
2>&1 || true
180182
181183
exit ${SEMGREP_EXIT:-0}
182184
185+
- name: Strip nosemgrep-suppressed findings from SARIF
186+
if: always()
187+
run: |
188+
# GitHub Code Scanning does not honour SARIF suppression markers,
189+
# so remove results that Semgrep already marked as suppressed via
190+
# nosemgrep inline comments.
191+
python3 - <<'PYEOF'
192+
import json, sys, pathlib
193+
194+
sarif_path = pathlib.Path("semgrep-results.sarif")
195+
if not sarif_path.exists():
196+
sys.exit(0)
197+
198+
sarif = json.loads(sarif_path.read_text())
199+
for run in sarif.get("runs", []):
200+
run["results"] = [
201+
r for r in run.get("results", [])
202+
if not r.get("suppressions")
203+
]
204+
sarif_path.write_text(json.dumps(sarif))
205+
PYEOF
206+
183207
- name: Upload SARIF
184208
if: always()
185209
uses: github/codeql-action/upload-sarif@v3

.openspp-lint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ rules:
7171
- "line_ids" # Generic line items (typically <20)
7272
- "manager_ids" # Program managers (typically <10)
7373
- "approver_ids" # Approval workflow (typically <5)
74+
- "bank_ids" # Bank accounts (typically 1-5 per person)
75+
- "phone_number_ids" # Phone numbers (typically 1-3 per person)
76+
- "entitlement_manager_ids" # Entitlement managers (typically <10 per program)
77+
- "payment_manager_ids" # Payment managers (typically <10 per program)
78+
- "farm_machinery_ids" # Farm machinery (typically <20 per farm)
7479

7580
# Severity overrides (change default severity for rules)
7681
# Valid values: error, warning, info

.pre-commit-config.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ repos:
138138
- id: pylint_odoo
139139
args:
140140
- --rcfile=.pylintrc-mandatory
141+
exclude: ^spp$|^scripts/|^(base_user_role|endpoint_route_handler|extendable|extendable_fastapi|fastapi|openspp-vocabularies|openspp|theme_openspp_muk|queue_job)/
141142
# ============================================================================
142143
# OpenSPP Custom Linting Rules
143144
# Based on docs/principles/ - see scripts/lint/README.md for details
@@ -147,7 +148,8 @@ repos:
147148
# Phase 1: Simple pattern-based checks (pygrep)
148149
- id: openspp-no-assertraises-tuple
149150
name: "OpenSPP: No tuple in assertRaises"
150-
description: "Odoo's assertRaises doesn't support tuple of exceptions like stdlib unittest"
151+
description:
152+
"Odoo's assertRaises doesn't support tuple of exceptions like stdlib unittest"
151153
entry: 'self\.assertRaises\s*\(\s*\('
152154
language: pygrep
153155
types: [python]
@@ -202,7 +204,8 @@ repos:
202204
# Phase 2: Compliance check (security spec validation)
203205
- id: openspp-compliance-check
204206
name: "OpenSPP: Security compliance check"
205-
description: "Validate modules with compliance.yaml against actual security config"
207+
description:
208+
"Validate modules with compliance.yaml against actual security config"
206209
entry: python -m scripts.compliance.checker --all
207210
language: python
208211
additional_dependencies:
@@ -236,7 +239,9 @@ repos:
236239
# Phase 3: UI patterns check (warning only)
237240
- id: openspp-check-ui
238241
name: "OpenSPP: UI patterns"
239-
description: "Check list limits, sample data, XPath syntax, statusbar location, extension points"
242+
description:
243+
"Check list limits, sample data, XPath syntax, statusbar location, extension
244+
points"
240245
entry: python scripts/lint/check_ui_patterns.py
241246
language: python
242247
additional_dependencies:
@@ -272,7 +277,8 @@ repos:
272277
# API authentication enforcement
273278
- id: openspp-check-api-auth
274279
name: "OpenSPP: API endpoint authentication"
275-
description: "Verify all API endpoints require authentication (allowlist for public)"
280+
description:
281+
"Verify all API endpoints require authentication (allowlist for public)"
276282
entry: python scripts/audit-api-auth.py --strict
277283
language: python
278284
pass_filenames: false
@@ -293,6 +299,7 @@ repos:
293299
hooks:
294300
- id: semgrep
295301
args: ["--config", ".semgrep/", "--error", "--quiet"]
302+
additional_dependencies: ["setuptools<82"]
296303
# Only scan OpenSPP spp_* modules (not scripts, endpoint handlers, etc.)
297304
files: ^spp_
298305
# Exclude test files, migrations, and demo-only modules

.pylintrc-mandatory

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,14 @@ valid-odoo-versions=19.0
1313
[MESSAGES CONTROL]
1414
disable=all
1515

16+
# Mandatory checks: these block CI. High-volume cosmetic checks
17+
# (attribute-string-redundant, except-pass, missing-return, etc.)
18+
# are in the optional .pylintrc only, enforced via --exit-zero.
1619
enable=anomalous-backslash-in-string,
17-
api-one-deprecated,
18-
api-one-multi-together,
1920
assignment-from-none,
20-
attribute-deprecated,
21-
class-camelcase,
2221
dangerous-default-value,
23-
dangerous-view-replace-wo-priority,
2422
development-status-allowed,
25-
duplicate-id-csv,
2623
duplicate-key,
27-
duplicate-xml-fields,
28-
duplicate-xml-record-id,
29-
eval-referenced,
30-
eval-used,
31-
incoherent-interpreter-exec-perm,
3224
license-allowed,
3325
manifest-author-string,
3426
manifest-deprecated-key,
@@ -37,58 +29,23 @@ enable=anomalous-backslash-in-string,
3729
manifest-version-format,
3830
method-compute,
3931
method-inverse,
40-
method-required-super,
4132
method-search,
42-
openerp-exception-warning,
4333
pointless-statement,
44-
pointless-string-statement,
4534
print-used,
46-
redundant-keyword-arg,
47-
redundant-modulename-xml,
4835
reimported,
49-
relative-import,
5036
return-in-init,
51-
rst-syntax-error,
5237
sql-injection,
5338
too-few-format-args,
5439
translation-field,
55-
translation-required,
5640
unreachable,
57-
use-vim-comment,
58-
wrong-tabs-instead-of-spaces,
5941
xml-syntax-error,
60-
attribute-string-redundant,
61-
character-not-valid-in-resource-link,
62-
consider-merging-classes-inherited,
6342
context-overridden,
64-
create-user-wo-reset-password,
65-
dangerous-filter-wo-user,
66-
dangerous-qweb-replace-wo-priority,
67-
deprecated-data-xml-node,
68-
deprecated-openerp-xml-node,
6943
duplicate-po-message-definition,
70-
except-pass,
71-
file-not-used,
72-
invalid-commit,
73-
manifest-maintainers-list,
74-
missing-newline-extrafiles,
75-
missing-readme,
76-
missing-return,
77-
odoo-addons-relative-import,
78-
old-api7-method-defined,
7944
po-msgstr-variables,
8045
po-syntax-error,
8146
renamed-field-parameter,
8247
resource-not-exist,
83-
str-format-used,
8448
test-folder-imported,
85-
translation-contains-variable,
86-
translation-positional-used,
87-
unnecessary-utf8-coding-comment,
88-
website-manifest-key-not-valid-uri,
89-
xml-attribute-translatable,
90-
xml-deprecated-qweb-directive,
91-
xml-deprecated-tree-attribute,
9249
external-request-timeout
9350

9451
[REPORTS]

.ruff.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ extend-select = [
1111
"UP", # pyupgrade
1212
]
1313
extend-safe-fixes = ["UP008"]
14-
exclude = ["setup/*"]
14+
exclude = ["setup/*", "fastapi/*", "base_user_role/*", "endpoint_route_handler/*", "extendable/*", "extendable_fastapi/*", "openspp-vocabularies/*", "openspp/*", "theme_openspp_muk/*", "queue_job/*"]
1515

1616
[format]
17-
exclude = ["setup/*"]
17+
exclude = ["setup/*", "fastapi/*", "base_user_role/*", "endpoint_route_handler/*", "extendable/*", "extendable_fastapi/*", "openspp-vocabularies/*", "openspp/*", "theme_openspp_muk/*", "queue_job/*"]
1818

1919
[lint.per-file-ignores]
2020
"__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py

.semgrep/odoo-security.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,13 @@ rules:
6868
owasp: "A03:2021 Injection"
6969

7070
- id: odoo-unsafe-safe-eval
71-
patterns:
72-
- pattern-either:
73-
- pattern: safe_eval(...)
74-
- pattern: odoo.tools.safe_eval.safe_eval(...)
75-
- pattern: odoo.tools.safe_eval.test_expr(...)
76-
# Suppress in compute methods and known-safe domain evaluation
77-
# contexts where the input is developer-controlled, not user-controlled.
78-
- pattern-not-inside: |
79-
def _compute_$METHOD(...):
80-
...
81-
- pattern-not-inside: |
82-
def action_domain_eval(...):
83-
...
71+
# NOTE: pattern-not-inside blocks removed - semgrep v1.90.0 cannot parse
72+
# metavariable/ellipsis patterns in Python function definitions.
73+
# Use nosemgrep inline annotations for known-safe usage.
74+
pattern-either:
75+
- pattern: safe_eval(...)
76+
- pattern: odoo.tools.safe_eval.safe_eval(...)
77+
- pattern: odoo.tools.safe_eval.test_expr(...)
8478
message: |
8579
safe_eval() is NOT safe with user input!
8680
It can be bypassed to achieve code execution.
@@ -227,7 +221,8 @@ rules:
227221
- pattern: _logger.$METHOD(..., $RECORD.national_id, ...)
228222
- pattern: _logger.$METHOD(..., $RECORD.tax_id, ...)
229223
- pattern: _logger.$METHOD(..., $RECORD.vat, ...)
230-
message: "Potential PII (national/tax ID) in log message - CRITICAL privacy violation."
224+
message:
225+
"Potential PII (national/tax ID) in log message - CRITICAL privacy violation."
231226
severity: ERROR
232227
languages: [python]
233228
metadata:

0 commit comments

Comments
 (0)