Skip to content

Conversation

@simahawk
Copy link
Contributor

Several fixes to make it work properly on v18.
Most important fix is

shopfloor_base: fix routing registration

The app was not using at all the base_rest dispatcher for restapi route type.
This is because by defualt endpoint.route.handler use only http or json

This was breaking _unregister_controllers since we don't get tuples
but EndpointRule objects.

Prior to this change the call failed like

  File /odoo/external-src/shopfloor-app/shopfloor_base/models/shopfloor_app.py, line 166, in _registered_endpoint_rule_keys
    return [x[0] for x in self._registered_routes()]
            ~^^^
TypeError: 'EndpointRule' object is not subscriptable
* ensure manifest url is always the same
* improve comparison on handler options
The app was not using at all the base_rest dispatcher for restapi route type.
This is because by default endpoint.route.handler use only http or json
Provides fix for existing installations.
@OCA-git-bot
Copy link
Contributor

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

Copy link

@florentx florentx left a comment

Choose a reason for hiding this comment

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

LG

@@ -0,0 +1,32 @@
# Copyright 2025 Camptocamp SA

Choose a reason for hiding this comment

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

There are two identical migration files. This one is redundant, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

one is for whoever lands on 18.0.1.0.0 and one for who's already on 18..0.1.0.2. Although 1.0.3 should run as well in the 1st case, I prefer to keep it as is.

@simahawk
Copy link
Contributor Author

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 18.0-ocabot-merge-pr-19-by-simahawk-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot OCA-git-bot merged commit 1d37ab6 into OCA:18.0 Sep 19, 2025
6 of 7 checks passed
registry = app._endpoint_registry
rules = list(registry.get_rules_by_group(app._route_group()))
for rule in rules:
rule.routing = dict(rule.routing, readonly=True, type="restapi")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
rule.routing = dict(rule.routing, readonly=True, type="restapi")
rule.routing = dict(rule.routing, readonly=False, type="restapi")

This wrong, of course! Dumb me! I'll fix it.

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.

4 participants