【问题标题】:Migration odoo, Style error Could not get content迁移odoo,样式错误无法获取内容
【发布时间】:2022-11-09 18:16:08
【问题描述】:

我将数据库升级到 Odoo 15,但仍然出现此错误:

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'.

和浏览器的日志:

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

我已经查找了这些文件,但在插件 src 文件中没有找到它们,还删除了所有 js 的 ir_attachemnts ! 有没有人遇到过这个错误并找到了解决方案?

【问题讨论】:

    标签: odoo database-migration odoo-15


    【解决方案1】:

    问题的原因

    当较新版本的应用程序中不再存在静态文件时,会发生此问题。执行迁移后,资产包仍然希望找到它们。

    解决方案

    您可以从 shell 中删除这些资产对象,例如:

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

    替代解决方案

    也许我们可以创建这些文件。例如,在您的情况下,在web.assets_backend 中创建一个空文件/web_gantt_native/static/src/js/gantt_item_sorted.jsinclude(Odoo Assets 文档)。完成后,问题应该消失,数据库应该正常运行。

    【讨论】:

      猜你喜欢
      • 2021-09-08
      • 1970-01-01
      • 1970-01-01
      • 2016-04-09
      • 2017-05-28
      • 1970-01-01
      • 1970-01-01
      • 2021-08-30
      • 2017-10-15
      相关资源
      最近更新 更多