[FIX] point_of_sale: prevent menu_service from loading

Before this commit, the menu_service was not included into the pos.assets_backend bundle
which was fine until menu_service defined a helper function that other service would need.
Since pos.assets_backend imports virtually all web.assets_backend, there was dependencies errors.
Hence the need to import the menu_service as well, but making sure it doesn't make the rpc to load the menus.

After this commit, there are no dependency issues, and the menus are not loaded, as expected and as before.

Part-of: odoo/odoo#75396
This commit is contained in:
Lucas Perais (lpe)
2021-08-30 13:27:57 +00:00
parent 5b05352c99
commit 7ddcebfcda
2 changed files with 3 additions and 1 deletions
-1
View File
@@ -171,7 +171,6 @@
],
'point_of_sale.pos_assets_backend': [
('include', 'web.assets_backend'),
('remove', 'web/static/src/webclient/menu_service.js'),
('remove', 'web/static/src/core/errors/error_handlers.js'),
('remove', 'web/static/src/legacy/legacy_rpc_error_handler.js'),
],
@@ -32,6 +32,9 @@
'login_number': login_number,
'debug': debug,
})"/>;
// Prevent the menu_service to load anything. In an ideal world, POS assets would only contain
// what is genuinely necessary, and not the whole backend.
odoo.loadMenusPromise = Promise.resolve();
odoo.loadTemplatesPromise = fetch(`/web/webclient/qweb/${odoo.__session_info__.cache_hashes.qweb}?bundle=web.assets_qweb`).then(doc => doc.text());
</script>