Skip to content

useService("rpc") no longer exists on Odoo 19 - latent crash in spp_change_request_v2 review panel and spp_dci_compliance security warning #450

Description

@gonzalesedwin1123

Odoo 19 removed the rpc web service (and the user service): useService("rpc") throws at component setup(), so any component still requesting it crashes the moment it is mounted.

Two components on 19.0 still use it:

  • spp_change_request_v2/static/src/components/review_panel/review_panel.js:27this.rpc = useService("rpc");
  • spp_dci_compliance/static/src/components/security_warning/security_warning.js:19this.rpc = useService("rpc");

The asset bundle compiles fine (imports resolve), so this only surfaces at runtime when the component is actually rendered — the same latent-crash class fixed for the masked_char widget in #232.

Fix: replace with the Odoo 19 APIs already used elsewhere in the repo (e.g. spp_farmer_registry/static/src/js/registry_restriction.js, spp_gis):

  • import {rpc} from "@web/core/network/rpc"; for custom routes, or the orm service (useService("orm")) for model method calls;
  • import {user} from "@web/core/user"; where the removed user service is needed.

Each fix should verify the component actually renders afterward (these two evidently have no test/tour coverage that mounts them, or CI would have caught the crash).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions