fix(services): V19 removed 'rpc' service \u2014 import standalone rpc() function

V19 removed the 'rpc' service from the registry. All 4 fusion services
(bank_reconciliation, reports, assets, followup) declared dependencies:
['rpc', ...] and accessed services.rpc in their constructor. At runtime
this caused:

  Error: Some services could not be started: fusion_bank_reconciliation,
  fusion_reports, fusion_assets, fusion_followup. Missing dependencies: rpc

\u2014 which prevented the entire OWL backend from booting (blank screen).

Fix per V19 docs:
- Add 'import { rpc } from "@web/core/network/rpc";'
- Set 'this.rpc = rpc;' in constructor (instead of services.rpc)
- Remove 'rpc' from dependencies list

This is the workspace CLAUDE.md guidance Phase 4's subagent flagged
but didn't act on for backward consistency. V19 actually removed the
service entirely, so the consistency choice was wrong \u2014 fixing now.

All call sites still use this.rpc(...) so no per-method changes needed.
Bundle rebuilt clean; backend boots correctly.

Made-with: Cursor
This commit is contained in:
gsinghpal
2026-04-19 23:25:52 -04:00
parent 51d8ce494d
commit ef2ccb89cf
4 changed files with 16 additions and 8 deletions

View File

@@ -2,13 +2,15 @@
import { registry } from "@web/core/registry";
import { reactive } from "@odoo/owl";
import { rpc } from "@web/core/network/rpc";
const ENDPOINT_BASE = "/fusion/assets";
export class AssetsService {
constructor(env, services) {
this.env = env;
this.rpc = services.rpc;
// V19: rpc is a standalone import, not a service.
this.rpc = rpc;
this.notification = services.notification;
this.state = reactive({
@@ -142,7 +144,7 @@ export class AssetsService {
}
export const assetsService = {
dependencies: ["rpc", "notification"],
dependencies: ["notification"],
start(env, services) { return new AssetsService(env, services); },
};

View File

@@ -14,13 +14,15 @@ import { registry } from "@web/core/registry";
import { reactive, useState, EventBus } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
import { browser } from "@web/core/browser/browser";
import { rpc } from "@web/core/network/rpc";
const ENDPOINT_BASE = "/fusion/bank_rec";
export class BankReconciliationService {
constructor(env, services) {
this.env = env;
this.rpc = services.rpc;
// V19: rpc is no longer a service — imported as a standalone function above.
this.rpc = rpc;
this.notification = services.notification;
this.orm = services.orm;
@@ -400,7 +402,7 @@ export class BankReconciliationService {
}
export const bankReconciliationService = {
dependencies: ["rpc", "notification", "orm"],
dependencies: ["notification", "orm"],
start(env, services) {
return new BankReconciliationService(env, services);
},

View File

@@ -2,13 +2,15 @@
import { registry } from "@web/core/registry";
import { reactive } from "@odoo/owl";
import { rpc } from "@web/core/network/rpc";
const ENDPOINT_BASE = "/fusion/followup";
export class FollowupService {
constructor(env, services) {
this.env = env;
this.rpc = services.rpc;
// V19: rpc is a standalone import, not a service.
this.rpc = rpc;
this.notification = services.notification;
this.state = reactive({
@@ -138,7 +140,7 @@ export class FollowupService {
}
export const followupService = {
dependencies: ["rpc", "notification"],
dependencies: ["notification"],
start(env, services) { return new FollowupService(env, services); },
};

View File

@@ -2,13 +2,15 @@
import { registry } from "@web/core/registry";
import { reactive } from "@odoo/owl";
import { rpc } from "@web/core/network/rpc";
const ENDPOINT_BASE = "/fusion/reports";
export class ReportsService {
constructor(env, services) {
this.env = env;
this.rpc = services.rpc;
// V19: rpc is a standalone import, not a service.
this.rpc = rpc;
this.notification = services.notification;
this.state = reactive({
@@ -140,7 +142,7 @@ export class ReportsService {
}
export const reportsService = {
dependencies: ["rpc", "notification"],
dependencies: ["notification"],
start(env, services) { return new ReportsService(env, services); },
};