Hello everyone,
I'm currently working on customizing a module in Odoo 17 and have encountered an issue that I'm hoping to get some assistance with. I'm trying to extend App.kioskAttendanceApp.prototype by adding this.actionService = useService("action"); in the setup function. However, after making this change, I'm consistently getting an error message in the web console:
Error:
Error: Service action is not available
This error occurs even when I directly modify the original JavaScript file (without patch). Here's the code snippet where I've added the actionService:
javascript
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import App from "@hr_attendance/public_kiosk/public_kiosk_app";
import { useService } from "@web/core/utils/hooks";
import { useBus } from "@web/core/utils/hooks";
patch(App.kioskAttendanceApp.prototype, {
setup() {
super.setup();
console.log("setup kioskAttendanceApp");
console.log(this.env);
this.actionService = useService("action");
},
async triggerVehicleAction(action) {
this.env.bus.trigger('perform_vehicle_action', {action});
},
});
Does anyone have any insights into why this might be happening or suggestions on how to successfully include the action service in my extension? Any help or pointers would be greatly appreciated.
Thank you in advance!