我正在尝试在中插入新记录股票数量. 当我通过以下SQL查询进行尝试时,这是有效的:
INSERT INTO stock_quant (create_date, qty, create_uid, location_id, company_id, write_date, write_uid, product_id, in_date) VALUES (now(), +20, 1, 12, 1, now(), 1, 8, now())
现在我想在奥多做同样的事情。 我已经试过了:
^{pr2}$但这给了我一个完整性错误:
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: location_id - location.id]
我想这可能和位置有点关系股票数量. 但不会出错的产品标识也是如此。在
我还试图用obj_magazijn和obj代替“12”_杂志id公司名称:
obj_magazijn ==> stock.location(12,)
obj_magazijn.id ==> 12
以及
obj_magazijn = self.env[('stock.location')].search([('id', '=', 12)])
有人知道这个错误的真正原因和/或知道解决方法吗?在
我不认为有什么错除了语法。在
自我.env[('股票数量')]替换为自我.env['股票数量']
了解有关Environment的详细信息
相关问题 更多 >
编程相关推荐