Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
4827 Vues

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.

Avatar
Ignorer
Auteur

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');

Meilleure réponse

did you find a solution please? same problem in v15

Avatar
Ignorer
Meilleure réponse

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

and add web in depends

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
juin 25
397
1
juin 25
353
1
mai 25
948
0
mars 25
557
1
déc. 24
3300