odoo/documentation#13235
Created by fw-bot
Merged
at 7c0b0226d4cdc490318e167290557cee8594037e
Statuses:
- ci/documentation: (runtime 992s)
- ci/codeowner_coverage: (runtime 5s)
- label
- odoo-dev:master-18.0-434103-fw
- head
- 3d311cfe367200c5dc7dbdc4e883bc9ac16da42d
- merged
- 1 day ago by JavaScript, Florent Dardenne (dafl)
odoo/documentation | |
---|---|
18.0 | #13151 |
saas-18.1 | #13232 |
saas-18.2 | #13233 |
saas-18.3 | #13234 |
master | #13235 |
[FW][FIX] rpc: fix code examples for tutorial and service
I am a newbie from April and was following the "Discover the web framework" guide (https://www.odoo.com/documentation/18.0/developer/tutorials/discover_js_framework/02_build_a_dashboard.html#call-the-server-add-some-statistics) and saw that the link and example provided were outdated.
For example, it was like this:
setup() {
this.rpc = useService("rpc");
onWillStart(async () => {
const result = await this.rpc("/my/controller", {a: 1, b: 2});
// ...
});
}
Which is now
import { rpc } from "@web/core/network/rpc";
// ...
setup() {
onWillStart(async () => {
const syncResult = await rpc("/my/controller", {a: 1, b: 2});
})
// ...
}
I also changed the code example inside the Reference for the RPC service as it was also out of date. There might be a need to move this to another category as it might not be a Service anymore, I wasn't able to determine is it would be best or not (or which one would be best).
Forward-Port-Of: #13151