← Back to Pull requests

[20.0][FIX] dms: upload size limit of 0 refused every upload #548

Open
unknown opened this pull request with 159 lines diff across 1 files
View on GitHub
unknown unknown commented on Nov 18, 2026 20:32 UTC
Author

The "Size" setting of Documents (dms.binary_max_size) has no default value. Until the parameter exists, the settings page shows 0, and saving the settings for any other reason stores 0 (in 20.0, set_values() writes the integer with set_int). From then on _get_binary_max_size() returns 0 and every upload is refused with "The maximum upload size is 0 MB".

We hit it on a production database: the settings were saved for an unrelated option, and nobody could upload a document any more.

Changes:

  • documents_binary_max_size defaults to 25, the limit already used when the parameter is missing

  • _get_binary_max_size() treats a zero or negative value as unset and falls back to 25

  • a post-migration (20.0.1.0.1) removes a zero or negative value already stored, so the default applies again
  • Tests:

  • new test test_binary_max_size_zero_is_default. It fails without the fix

  • all dms tests pass on Odoo 20.0 Community (official image, 20.0-20260926, with Chromium): 86 tests, 0 failures

  • migration replayed from 20.0.1.0.0 with the parameter at 0: the parameter is removed and the limit is 25 MB
  • The same issue seems to exist in 18.0 and 19.0 (no default on the field, and the settings store "0"). I can backport it if you want.

    Assisted-by: Claude Opus 5.5

    Diff: 159 lines (+119 / -40) across 1 files Reviewer: pedrobaeza Review duration: 5711m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.33) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.33 · 159 lines diff across 1 files
    0.33
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.304
    Real PR Conversation Timeline
    1 comments
    "Review active on #548"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 33.4% (LOW) · Higher = larger blast radius
    33.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.8% · Safe to merge
    17.8%
    Repository