【发布时间】:2016-02-04 11:34:58
【问题描述】:
完整性错误
操作无法完成,可能有以下原因:
- 删除:您可能正试图删除一条记录,而其他记录仍在引用它
- 创建/更新:未正确设置必填字段
[引用对象:日期 - 日期]
模型是good_reception。这是一个自定义模块。
不同的交易以良好接收的日期为准。昨天它运行良好,然后我删除了所有草稿数据,现在它显示该错误。
请注意,我备份了数据库,但无法恢复它。错误是
<br><br>could not restore the database
<br><br><code>
supplier = fields.Many2one("res.partner", string="Supplier",required=True)
received_goods = fields.One2many("rcs.stock_transaction", "reception")
received_by = fields.Many2one("res.users", readonly=True)
date = fields.Date(required=False)
state = fields.Selection([
('pending', "Pending"),
('received', "Received"),
], default='pending', readonly=True)
@api.one
def compute_name(self):
self.name = "Reception No:"+str(self.id)+", Supplier:"+self.supplier.name+", Date:"+self.date
【问题讨论】: