【问题标题】:odoo module data not deleted from database when i uninstall module当我卸载模块时,odoo 模块数据未从数据库中删除
【发布时间】:2019-01-30 04:54:55
【问题描述】:

当我卸载我的一个模块时,数据表不会从我的数据库中删除。通常,当我们卸载任何 odoo 模块时,所有的表和数据都会被删除。

类部分

class Section(models.Model):
    _name = "section.section"

    name = fields.Char(string='Section Name', required=True)
    question_ids = fields.One2many('question.question', 'section_id', copy=True)

课堂问题

class Question(models.Model):
    _name = "question.question"

    name = fields.Char(string='Question', required=True)
    section_id = fields.Many2one('section.section', string='Section', ondelete='cascade')

【问题讨论】:

  • 什么问题,你想做什么
  • 我已经创建了带有上述表格的小型 odoo 模块,但是当我卸载我的模块时会发生什么情况,它将卸载但在数据库表中不会删除。所以当我再次安装该模块时,旧数据已经存在......
  • 因为值已经输入到数据库中了。我认为直接从数据库中删除值或创建新数据库的最简单解决方案

标签: python odoo-10


【解决方案1】:

试试这个;

在 odoo ui 中打开开发者模式。之后在设置中,单击数据库结构和模型。搜索您的模型并将其删除。

创建新数据库并在其上安装您的模块。

【讨论】:

    猜你喜欢
    • 2020-04-03
    • 1970-01-01
    • 1970-01-01
    • 2017-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多