1

I upgraded the database to Odoo 15 but I still got this error:

Style error

The style compilation failed, see the error below. Your recent actions may be the cause, please try reverting the changes you made.

Could not get content for /web/static/src/scss/webclient.scss defined in bundle 'web.assets_backend'.

enter image description here

and the log of browser:

Could not get content for /web_gantt_native/static/src/js/gantt_item_sorted.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:27116:9
Could not get content for /web_gantt_native/static/src/js/gantt_item.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:27119:9
Could not get content for /knowsystem/static/src/js/knowsystem_action_manager.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28037:9
Could not get content for /knowsystem/static/src/js/knowsystem_readonly_formcontroller.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28040:9
Could not get content for /knowsystem/static/src/js/knowsystem_readonly_formview.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28043:9
Could not get content for /knowsystem/static/src/js/sidebar.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28046:9
Could not get content for /web_notify/static/src/js/web_client.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28980:9
Could not get content for /web_notify/static/src/js/widgets/notification.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28983:9

I already looked for the files but didn't find them in the addons src files also removed the ir_attachemnts for all js ! Any one got this error before and found a solution ?

m3asmi
  • 1,252
  • 1
  • 16
  • 36

2 Answers2

3

Cause of the issue

This issue happens when static files no longer exist in a newer version of an app. After the migration is performed the assets bundles still expect to find them.

Solution

You can just delete those asset objects from shell for example(and do the same with the rest):

env['ir.asset'].search([('path', '=', '/web_gantt_native/static/src/js/gantt_item_sorted.js')]).unlink()
env.cr.commit()

If the record does not exist on the database add the static file as explained in the alternative solution.

Alternative Solution

Temporarily create those files. For example in your case create an empty file /web_gantt_native/static/src/js/gantt_item_sorted.js and include(Odoo Assets documentation) it in web.assets_backend. Once that is done, the issue should be gone and the database should run normal.

-1

The answer provided looks fine, I just want to add that you can using the developer mode use the "regenerate asset bundle" feature that will help you with those kinds of assets issues.

ML-1994
  • 46
  • 3
  • You shoud add this as comment to the correct answer or mention the name of the person who gave the correct answer. – Loich Nov 13 '22 at 19:02
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/33143548) – Thomas Smyth - Treliant Nov 14 '22 at 12:24