Skip to content

[17.0][MIG] fastapi: Migration to 17.0 - #409

Merged
OCA-git-bot merged 12 commits into
OCA:17.0from
nguyenminhchien:17.0-mig-fastapi
Jun 6, 2024
Merged

[17.0][MIG] fastapi: Migration to 17.0#409
OCA-git-bot merged 12 commits into
OCA:17.0from
nguyenminhchien:17.0-mig-fastapi

Conversation

@nguyenminhchien

@nguyenminhchien nguyenminhchien commented Jan 8, 2024

Copy link
Copy Markdown
Contributor

@nguyenminhchien

nguyenminhchien commented Jan 8, 2024

Copy link
Copy Markdown
Contributor Author

The check failed because of the issue #141747

@nguyenminhchien
nguyenminhchien marked this pull request as ready for review January 8, 2024 05:19
@nguyenminhchien nguyenminhchien mentioned this pull request Jan 8, 2024
19 tasks
@hunghn

hunghn commented Jan 12, 2024

Copy link
Copy Markdown

Thank you, Mr. Chien, for your contribution. It works for me.

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

@nguyenminhchien Thank you for the migration. Con you remove the dependency on odoo-addon-endpoint-route-handler @ git+https://github.com/OCA/web-api.git@refs/pull/31/head#subdirectory=endpoint_route_handler This one is merged.

@nguyenminhchien

Copy link
Copy Markdown
Contributor Author

@nguyenminhchien Thank you for the migration. Con you remove the dependency on odoo-addon-endpoint-route-handler @ git+https://github.com/OCA/web-api.git@refs/pull/31/head#subdirectory=endpoint_route_handler This one is merged.

Removed, thanks.

@gurneyalex

Copy link
Copy Markdown
Member

/ocabot migration fastapi

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Jan 25, 2024
@gurneyalex

Copy link
Copy Markdown
Member

@lmignon @sbidoul it seems that Odoo 17 has issues with the addons having a 16.0.x.y.z version, even if they are installable=False

cf. https://github.com/OCA/rest-framework/actions/runs/7634588421/job/20798693591?pr=409#step:7:74

Is this something you prefer reporting as an issue to Odoo or handle in the test scripts or process with a commit updating the versions of the uninstallable addons in the repo?

@lmignon

lmignon commented Feb 2, 2024

Copy link
Copy Markdown
Contributor

@lmignon @sbidoul it seems that Odoo 17 has issues with the addons having a 16.0.x.y.z version, even if they are installable=False

cf. https://github.com/OCA/rest-framework/actions/runs/7634588421/job/20798693591?pr=409#step:7:74

Is this something you prefer reporting as an issue to Odoo or handle in the test scripts or process with a commit updating the versions of the uninstallable addons in the repo?

An issue is open on odoo regarding this problem odoo/odoo#141747

@rven

rven commented Feb 5, 2024

Copy link
Copy Markdown

After an update of Odoo the following error is raised on the fastapi module

odoo.tools.convert.ParseError: while parsing /opt/odoo/parts/oca_pull/fastapi/security/ir_rule+acl.xml:37
2002Invalid domain: <class 'NameError'>: "name 'authenticated_partner_id' is not defined" while evaluating
2003" ['|', ('user_id', '=', user.id), ('id', '=', authenticated_partner_id)]"
To fix this, the following code needs to be changed in fastapi/models/ir_rule.py

    @api.model
    def _eval_context(self):
        ctx = super()._eval_context()
        if "authenticated_partner_id" in self.env.context:
            ctx["authenticated_partner_id"] = self.env.context[
                "authenticated_partner_id"
            ]
        return ctx

Should be changed to this

    @api.model
    def _eval_context(self):
        ctx = super()._eval_context()
        ctx["authenticated_partner_id"] = self.env.context.get("authenticated_partner_id")
        return ctx

@sbidoul

sbidoul commented Feb 5, 2024

Copy link
Copy Markdown
Member

@rven this looks like #410

@nguyenminhchien

Copy link
Copy Markdown
Contributor Author

@rven this looks like #410

@rven @sbidoul I have picked #410

@ahmed-aly-aut

Copy link
Copy Markdown

@nguyenminhchien this pull request is now needed too #416

@nguyenminhchien
nguyenminhchien force-pushed the 17.0-mig-fastapi branch 2 times, most recently from 114895e to 956c1a3 Compare February 21, 2024 02:56
@nguyenminhchien

Copy link
Copy Markdown
Contributor Author

@nguyenminhchien this pull request is now needed too #416

I picked this one.

@lmignon lmignon added the 17.0 label Mar 14, 2024
@lmignon

lmignon commented Apr 16, 2024

Copy link
Copy Markdown
Contributor

/ocabot merge nobump

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

Code review only

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 17.0-ocabot-merge-pr-409-by-lmignon-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Apr 16, 2024
Signed-off-by lmignon
@dreispt

dreispt commented May 3, 2024

Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 17.0-ocabot-merge-pr-409-by-dreispt-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request May 3, 2024
Signed-off-by dreispt
@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 17.0-ocabot-merge-pr-409-by-sbidoul-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request May 26, 2024
Signed-off-by sbidoul
lmignon and others added 11 commits May 26, 2024 12:25
If you pass an override of the authenticated_partner_impl to the _create_test_client method, don't override it by a default one
This is to ensure that `retrying` in `service/model.py` does not try to flush.
Currently translated at 100.0% (41 of 41 strings)

Translation: rest-framework-16.0/rest-framework-16.0-fastapi
Translate-URL: https://translation.odoo-community.org/projects/rest-framework-16-0/rest-framework-16-0-fastapi/it/
…en evaluating ir rules

This fix is needed since a modificiation of ir.rule that checks the domain when creating/modifying ir rules
The solution is to set authenticate_partner_id to False when it is not present in context
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version

refs OCA#414
@sbidoul
sbidoul force-pushed the 17.0-mig-fastapi branch from c231e78 to 91e9647 Compare May 26, 2024 10:25
@sbidoul

sbidoul commented May 26, 2024

Copy link
Copy Markdown
Member

Ah I understand #409 (comment) now. The base branch CI was sill configured for 16.0. I ran copier update --trust, answered the questions for 17.0 and rebased.

@lmignon

lmignon commented Jun 6, 2024

Copy link
Copy Markdown
Contributor

/ocabot merge nobump

@lmignon

lmignon commented Jun 6, 2024

Copy link
Copy Markdown
Contributor

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 17.0-ocabot-merge-pr-409-by-lmignon-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jun 6, 2024
Signed-off-by lmignon
@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 17.0-ocabot-merge-pr-409-by-lmignon-bump-nobump, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit fc6ef5d into OCA:17.0 Jun 6, 2024
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

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.