I have some problems with loading the appropriate dependencies in odoo18 / web.ajax and and some other like web.core,
When I comments out the web.ajax, my JS is loaded but Cann some point out what is going wrong, and where cann i find the web.ajax in my odoo18.
console.log("💡 Breadcrumb JS loaded");
const ajax = require('web.ajax');
document.addEventListener("click", function (ev) {
const link = ev.target.closest(".o_breadcrumb_link");
if (!link) return;
ev.preventDefault();
const model = link.dataset.model;
const resId = parseInt(link.dataset.id, 10);
if (model && resId) {
const action = {
type: 'ir.actions.act_window',
res_model: model,
res_id: resId,
view_mode: 'form',
target: 'current',
};
// Use legacy ActionManager through WebClient
const $el = $('.o_web_client');
const actionManager = $el.data('action_manager');
if (actionManager) {
actionManager.do_action(action);
} else {
console.warn("Action manager not available.");
}
}
});
There is no web.ajax in Odoo 18.