Skip to content

[19.0][IMP] fastapi: parse db param in sessionless requests#608

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
ForgeFlow:19.0-fp-607
Apr 15, 2026
Merged

[19.0][IMP] fastapi: parse db param in sessionless requests#608
OCA-git-bot merged 1 commit into
OCA:19.0from
ForgeFlow:19.0-fp-607

Conversation

@LoisRForgeFlow

Copy link
Copy Markdown
Contributor

It is useful for multi-database environments.

Fwport of #607

It is useful for multi-database environments.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @lmignon,
some modules you are maintaining are being modified, check this out!

@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.

Thank you so much for the forward port @LoisRForgeFlow !

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@lmignon

lmignon commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 19.0-ocabot-merge-pr-608-by-lmignon-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit ad83d2e into OCA:19.0 Apr 15, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 4bc043d. Thanks a lot for contributing to OCA. ❤️

@sbidoul

sbidoul commented Apr 24, 2026

Copy link
Copy Markdown
Member

I have some worries about this. I had not noticed this feature before.

Is it not problematic that merely installing the fastapi module changes the way Odoo determines the database globally? Is it not preferable to do this in a standalone module that would be independent of fastapi?

@LoisRForgeFlow

Copy link
Copy Markdown
Contributor Author

I have some worries about this. I had not noticed this feature before.

Is it not problematic that merely installing the fastapi module changes the way Odoo determines the database globally? Is it not preferable to do this in a standalone module that would be independent of fastapi?

Hi @sbidoul

Odoo vanilla accepts db query param, so this is trying to make the same behavior happen with fastapi. I haven't seen the need to patch it in any other place.

Without db param odoo redirects you to the database selector. Example in a repo without this patch: http://oca-ddmrp-18-0-0cd23739c209.runboat.odoo-community.org/web/
image

Whereas if you include the db param you get redirected to that specific database: http://oca-ddmrp-18-0-0cd23739c209.runboat.odoo-community.org/odoo?db=b2a480f47-259f-4bdd-9d4c-dcb5194260ed-baseonly

image

What do you think?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants