Skip to Content
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
4778 Представления

I want to add UI blocker functionality (which is implemented by Odoo team themselves in web.framework module) to an existing javascript file in my own addon for Odoo 13.0+e (Enterprise Edition).

Before my changes, the JS module was tested and is working fine.

As soon as I add the following line:

let framework = require('web.framework');

Odoo stops loading the module and reports in Chrome console:

warning: Some modules could not be started
Missing dependencies:     (1) ["web.framework"]
Non loaded modules:     (1) ["my_addon.my_js_module"]  

When I activate developer mode in Odoo settings, I see that indeed browser loads many files from addons\web\static\src\js\core folder, except file misc.js where web.framework is defined.

I did Upgrade command on my module, I restarted Odoo, I tried developer and production modes and loaded the website with Disable cache setting - nothing helps, web.framework module is not loaded into my addon module.

The problematic js file also has other module dependencies:

let ajax = require('web.ajax');
let core = require('web.core');

and those are working fine. Only web.framework is breaking.

What's going on? How do I enforce loading of web.framework?


Updated later because I cannot reply in comments to others yet (not enough karma):


Komal said: 

write var framework = require('web.framework');

<- yes, that's what I did.


and add web in depends

<- How exactly do I do that?

And how would it help to load web.framework if the other web modules (web.ajax, web.core) are loaded normally? Doesn't this mean that web module has already been added? Odoo does not load only misc.js file from that module. Other files for ajax and core are being already loaded fine.

Аватар
Отменить
Автор

For a clean test, I just tried a Bitnami Odoo v13 installation and Website app. I customized the JS code for the webiste and have the issue - the JS module is not loaded anymore as soon as I add

var framework = require('web.framework');

Лучший ответ

did you find a solution please? same problem in v15

Аватар
Отменить
Лучший ответ

write var framework = require('web.framework');

and add web in depends

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
июн. 25
169
1
мая 25
794
0
мар. 25
423
1
дек. 24
3037
2
нояб. 24
1259