Skip to content

[16.0] shopfloor_base: critical fixes#1104

Draft
simahawk wants to merge 3 commits intoOCA:16.0from
camptocamp:16-fix-shopfloor_base-routing
Draft

[16.0] shopfloor_base: critical fixes#1104
simahawk wants to merge 3 commits intoOCA:16.0from
camptocamp:16-fix-shopfloor_base-routing

Conversation

@simahawk
Copy link

@simahawk simahawk commented Sep 19, 2025

Backport of OCA/shopfloor-app#19

shopfloor_base: fix _registered_endpoint_rule_keys

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

How to reproduce: archive an app and sync registry (or directly call the method on an existing active app).

shopfloor_base: fix routing registration (the most important fix)

This prevented the usage of the fastapi dispatcher leading - among other things - to broken handling of server side errors as exceptions are not wrapped.

How to reproduce: raise an exception server side (eg: override the 1st method of a scenario to raise an exception in any case) and see on the screen an alert w/ "undefined undefined" instead of a nice error message.

TODO

@lmignon I have no time to test this on 16 so I simply backported the fixes. Could you have a look?
Migrations scripts should be also ported (w/o the "readonly" flag) iif the issue is confirmed as all the existing routes should be updated.

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
@OCA-git-bot
Copy link
Contributor

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

@lmignon
Copy link

lmignon commented Sep 22, 2025

Thank you @simahawk. I take this PR on my TODO list.

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants