Skip to content

[19.0][MIG] api_log, api_log_mail, fastapi_log, fastapi_log_mail: Migration to 19.0 - #616

Open
TheClaud99 wants to merge 35 commits into
OCA:19.0from
TheClaud99:19.0-mig-log-modules
Open

TheClaud99 wants to merge 35 commits into
OCA:19.0from
TheClaud99:19.0-mig-log-modules

Conversation

@TheClaud99

@TheClaud99 TheClaud99 commented Jun 12, 2026 •

Copy link
Copy Markdown

Migration of the API/FastAPI logging modules to 19.0. They are submitted
together because they form a single dependency chain
(api_log → api_log_mail, api_log → fastapi_log → fastapi_log_mail).

Modules

  • api_log
  • api_log_mail
  • fastapi_log
  • fastapi_log_mail

Migration changes

  • Bumped manifest versions to 19.0.1.0.0.
  • api_log: renamed the res.groups users field to user_ids
    (the field was renamed in 19.0).
  • fastapi_log:
    • replaced the removed Registry.in_test_mode() with a test_log_cr
      attribute check in the FastAPI dispatcher;
    • updated the TestCursor import (odoo.sql_db → odoo.tests.test_cursor).
  • Regenerated README.rst and static/description/index.html for 19.0.

Related to #567

@OCA-git-bot OCA-git-bot added series:19.0 mod:fastapi_log_mail Module fastapi_log_mail mod:fastapi_log Module fastapi_log mod:api_log_mail Module api_log_mail mod:api_log Module api_log labels Jun 12, 2026
@TheClaud99
TheClaud99 force-pushed the 19.0-mig-log-modules branch 6 times, most recently from 95ebd5d to 4d8d927 Compare June 23, 2026 12:51

@lmignon lmignon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (Code review only)

@oca-cla-bot

oca-cla-bot Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@TheClaud99

Copy link
Copy Markdown
Author

Rebased on 19.0 — the DeprecationWarning that was failing checklog is fixed
repo-wide by #639, and the test jobs are green. The only red check left is the
CLA one.

@paradoxxxzero the CLA bot is flagging paradoxxx.zero@gmail.com on your
original commits of api_log modules. If that address isn't attached to your OCA CLA, could you proceed with the signing?
Thanks!

@jaenbox

jaenbox commented Oct 19, 2026

Copy link
Copy Markdown

api_log has the same issue fixed in #666 (17.0) and #667 (18.0): _prepare_log_exception does exception.headers = getattr(exception, "headers", {}), but Starlette/FastAPI
HTTPException have headers = None when raised without headers, so logging a 404/422 fails with TypeError: 'NoneType' object does not support item assignment.

Could you include it in the migration?

  if getattr(exception, "headers", None) is None:
      exception.headers = {}

@jaenbox

jaenbox commented Oct 20, 2026

Copy link
Copy Markdown

fastapi_log has the issue fixed in #668 (17.0) and #669 (18.0): _prepare_log_exception stores exception.detail as is in the binary response_body. FastAPI allows any JSON-serializable detail (e.g. a dict), so flushing the log fails and the request ends
in a 500.

Could you include it in the migration too?

  detail = exception.detail
  if not isinstance(detail, str | bytes):
      detail = json.dumps(detail, default=str)
  values.update(
      {
          "response_status_code": exception.status_code,
          "response_headers": self._headers_to_dict(exception.headers),
          "response_body": detail,
      }
  )

SirPyTech and others added 24 commits October 23, 2026 13:23
Currently translated at 100.0% (7 of 7 strings)

Translation: rest-framework-18.0/rest-framework-18.0-fastapi_log
Translate-URL: https://translation.odoo-community.org/projects/rest-framework-18-0/rest-framework-18-0-fastapi_log/it/
Currently translated at 100.0% (7 of 7 strings)

Translation: rest-framework-18.0/rest-framework-18.0-fastapi_log
Translate-URL: https://translation.odoo-community.org/projects/rest-framework-18-0/rest-framework-18-0-fastapi_log/it/
@TheClaud99
TheClaud99 force-pushed the 19.0-mig-log-modules branch from ee2a120 to 9e16524 Compare October 23, 2026 12:30
@TheClaud99

Copy link
Copy Markdown
Author

@jaenbox done, cherry-picked #667 and #669 (the 18.0 commits apply as is).
I also ported what landed on 18.0 after this PR was opened: #631 and a Weblate update for fastapi_log.
If #667/#669 change during review I'll sync them here.

Since you're running these modules, would you mind reviewing this one?

@jaenbox

jaenbox commented Oct 23, 2026 via email

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:api_log_mail Module api_log_mail mod:api_log Module api_log mod:fastapi_log_mail Module fastapi_log_mail mod:fastapi_log Module fastapi_log series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants