Openerp 试图保存供应商发票的完整性错误

Openerp 试图保存供应商发票的完整性错误,openerp,invoice,Openerp,Invoice,我构建了一个模块,用于增加供应商发票上的库存。在devel服务器上可以很好地工作,但是当我在工作服务器上双关时,我有这个错误。我如何纠正这个错误 Integrity Error The operation cannot be completed, probably due to the following: - deletion: you may be trying to delete a record while other records still reference it - crea

我构建了一个模块,用于增加供应商发票上的库存。在devel服务器上可以很好地工作,但是当我在工作服务器上双关时,我有这个错误。我如何纠正这个错误

Integrity Error

The operation cannot be completed, probably due to the following: - deletion: you may be trying to delete a record while other records still reference it - creation/update: a mandatory field is not correctly set

[object with reference: Purchase Order Line - purchase.order.line] 

OpenERP上出现完整性错误是因为两种可能性(错误描述中提到):

  • 创建或更新记录时,必填字段未正确设置或未填充。什么领域?对象中的一个字段(已提到)。在您的情况下:purchase.order.line
  • 删除记录时,要删除的记录将被另一条记录使用,并从python代码中将其设置为必填字段(必填)
我猜,如果在创建/更新记录(采购订单)时出现错误,可能是创建/更新订单行,但订单行中的一个必填字段为空