rest-framework icon indicating copy to clipboard operation
rest-framework copied to clipboard

[17.0][MIG] fastapi: Migration to 17.0

Open nguyenminhchien opened this issue 1 year ago • 28 comments

Ref: BSRD-708

Depends on:

  • [x] https://github.com/OCA/web-api/pull/31

nguyenminhchien avatar Jan 08 '24 04:01 nguyenminhchien

The check failed because of the issue #141747

nguyenminhchien avatar Jan 08 '24 05:01 nguyenminhchien

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

hunghn avatar Jan 12 '24 10:01 hunghn

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

nguyenminhchien avatar Jan 24 '24 02:01 nguyenminhchien

/ocabot migration fastapi

gurneyalex avatar Jan 25 '24 17:01 gurneyalex

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

gurneyalex avatar Feb 02 '24 07:02 gurneyalex

@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 https://github.com/odoo/odoo/issues/141747

lmignon avatar Feb 02 '24 08:02 lmignon

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

rven avatar Feb 05 '24 08:02 rven

@rven this looks like https://github.com/OCA/rest-framework/pull/410

sbidoul avatar Feb 05 '24 09:02 sbidoul

@rven this looks like #410

@rven @sbidoul I have picked https://github.com/OCA/rest-framework/pull/410

nguyenminhchien avatar Feb 19 '24 03:02 nguyenminhchien

@nguyenminhchien this pull request is now needed too #416

ahmed-aly-aut avatar Feb 20 '24 16:02 ahmed-aly-aut

@nguyenminhchien this pull request is now needed too #416

I picked this one.

nguyenminhchien avatar Feb 21 '24 02:02 nguyenminhchien

/ocabot merge nobump

lmignon avatar Apr 16 '24 08:04 lmignon

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 avatar Apr 16 '24 08:04 OCA-git-bot

/ocabot merge nobump

dreispt avatar May 03 '24 08:05 dreispt

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 avatar May 03 '24 08:05 OCA-git-bot

/ocabot merge nobump

dreispt avatar May 11 '24 17:05 dreispt

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

OCA-git-bot avatar May 11 '24 17:05 OCA-git-bot

/ocabot merge nobump

dreispt avatar May 18 '24 18:05 dreispt

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

OCA-git-bot avatar May 18 '24 18:05 OCA-git-bot

can someone approve?

ahmed-aly-aut avatar May 20 '24 08:05 ahmed-aly-aut

Hi @dreispt could you please try again your merge bot command? I believe it wasn't going through previously because of an old pending runboat build, but this has now been fixed thanks to Chien's rebase

nilshamerlinck avatar May 24 '24 03:05 nilshamerlinck

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). 🤖

OCA-git-bot avatar May 24 '24 08:05 OCA-git-bot

/ocabot merge nobump

lmignon avatar May 24 '24 14:05 lmignon

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

OCA-git-bot avatar May 24 '24 14:05 OCA-git-bot

Hi @dreispt could you please try again your merge bot command? I believe it wasn't going through previously because of an old pending runboat build, but this has now been fixed thanks to Chien's rebase

Yikes, wrong hypothesis :sweat_smile:

Hi @sbidoul the 17.0 branch of this repo is based on 16.0 and some manual changes

Do you think it could now be initialized "normally" through copier?

nilshamerlinck avatar May 26 '24 09:05 nilshamerlinck

Hm, weird. Trying again.

/ocabot merge nobump

sbidoul avatar May 26 '24 10:05 sbidoul

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 avatar May 26 '24 10:05 OCA-git-bot

Ah I understand https://github.com/OCA/rest-framework/pull/409#issuecomment-2132153109 now. The base branch CI was sill configured for 16.0. I ran copier update --trust, answered the questions for 17.0 and rebased.

sbidoul avatar May 26 '24 10:05 sbidoul

/ocabot merge nobump

lmignon avatar Jun 06 '24 06:06 lmignon

/ocabot merge nobump

lmignon avatar Jun 06 '24 06:06 lmignon