跳至內容
選單
此問題已被標幟
2 回覆
4958 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
6月 25
289
1
6月 25
610
1
6月 25
598
1
5月 25
1169
0
3月 25
666