我目前正在按照 odoo.sh 中的升级流程迁移到 Odoo v15。
由于某些模板在 v15 中已被删除或重命名,因此我收到了 100 个类似以下内容的错误:
ValueError: External ID not found in the system: website_blog.s_latest_posts
大多数这些错误是由版本 13 上的第三方模板引起的。
如何处理在目标(v15)版本中不再存在但在当前版本(v13)中用作继承模板的(主题)模板?
例如:
website_blog.s_latest_posts.xml 存在于 v13 的官方 src/odoo/addons 中,但在 v15 中不存在。我已经使用继承定制了这个模板:
<template id="my_s_latest_post" inherit_id="website_blog.s_latest_posts"><xpath="..."></xpath></template>
“第三方主题”模块“third_party_theme”继承自它:
<template id="thirdpartytheme_s_latest_post" inherit_id="website_blog.s_latest_posts"><xpath="..."></xpath></template>
以及我的其他自定义模板,它们继承自third_party_theme 的模板:
<template id="my_other_s_latest_post" inherit_id="third_party_theme.thirdpartytheme_s_latest_post"><xpath="..."></xpath></template>
或我的自定义模板或第三方主题的其他部分调用原始模板:
<template><xpath=xxx>
<t t-call=third_party_theme.thirdpartytheme_s_latest_post...
并且由于website_blog.s_latest_posts.xml在v15中不再存在,因此在迁移过程(odoo.sh)中,出现这样的错误:ValueError: External ID not found in the system: website_blog.s_latest_posts
我听说过预迁移脚本可以在迁移过程中禁用视图:https://www.youtube.com/watch?v=n0jQQlEnUUQ https://www.youtube.com/watch?v=n0jQQlEnUUQ但我不知道如何管理处理视图的步骤(请参阅附件中的屏幕截图)。欢迎使用脚本示例(pre-migrate.py、post-migrate.py 和 end-migrate.py):)
我还尝试弄清楚如何处理 OpenUpgrade 信息:https://github.com/OCA/OpenUpgrade/blob/15.0/openupgrade_scripts/scripts/website_blog/15.0.1.1/upgrade_analysis.txt https://github.com/OCA/OpenUpgrade/blob/15.0/openupgrade_scripts/scripts/website_blog/15.0.1.1/upgrade_analysis.txt例如:
---Models in module 'website_blog'---
---Fields in module 'website_blog'---
---XML records in module 'website_blog'---
NEW ir.asset: website_blog.s_blog_posts_000_js
NEW ir.ui.view: website_blog.s_blog_posts
DEL ir.ui.view: website_blog.assets_editor
DEL ir.ui.view: website_blog.assets_frontend
DEL ir.ui.view: website_blog.assets_snippet_s_latest_posts_css_000
DEL ir.ui.view: website_blog.s_latest_posts
DEL ir.ui.view: website_blog.s_latest_posts_big_picture_template
NEW website.snippet.filter: website_blog.dynamic_filter_latest_blog_posts