wms icon indicating copy to clipboard operation
wms copied to clipboard

[16.0] shopfloor_base: critical fixes

Open simahawk opened this issue 3 months ago • 2 comments

Backport of https://github.com/OCA/shopfloor-app/pull/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.

simahawk avatar Sep 19 '25 10:09 simahawk

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

OCA-git-bot avatar Sep 19 '25 10:09 OCA-git-bot

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

lmignon avatar Sep 22 '25 08:09 lmignon