【问题标题】:Getting this error while upgrading website_sale on Odoo v16在 Odoo v16 上升级 website_sale 时出现此错误
【发布时间】:2023-02-21 02:37:41
【问题描述】:
Element '<t name="Sort-by Template" t-name="website_sale.sort">' cannot be located in parent view

View error context:
{'file': '/home/developer/Documents/odoo_16/Odoo/addons/website_sale/views/templates.xml',
 'line': 1,
 'name': 'Sort-by Template',
 'view': ir.ui.view(1868,),
 'view.model': False,
 'view.parent': ir.ui.view(1866,),
 'xmlid': 'products'}

尝试从数据库中删除这些记录,但出现另一个错误。

【问题讨论】:

    标签: odoo odoo-16


    【解决方案1】:

    这只是意味着,在您当前的版本(v12?)中,您已经创建了一个继承视图(ir.ui.view(1868,)),它链接到父视图(“website_sale.sort”),它存在于您当前的版本,但在 Odoo v16 中不再存在。 您可以停用或删除您的视图 (id=1868)。

    我找到的解决方案是在我的自定义模块之一中使用 pre-migrate.py 文件:my_custom_module/migrations/16.0.0.0.0/pre-migrate.py,其中包含我需要执行的 Sql 查询,以更正升级日志错误:

    def 迁移(cr,版本):

    # TO CORRECT UPGRADE ERROR 1 : Element '<xpath expr="//xxxx">' cannot be located in parent view
    
    cr.execute("""
        update ir_ui_view v
        set inherit_id = NULL, mode='primary', active = false
        where
        v.id in (1868)
    """)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-28
      • 1970-01-01
      • 2018-12-22
      • 1970-01-01
      • 2023-02-20
      • 2022-08-24
      相关资源
      最近更新 更多