在 Odoo 10 中将产品数量设置为 0

Set product quantities to 0 in Odoo 10

我们已准备好将我们的实例部署到生产环境中,我目前正在清理在此过程中制作的所有演示数据。

我通常按照以下步骤清理主要样本数据:

SSH 进入服务器

su postgres
psql abc_db_name

delete from stock_pack_operation;
delete from stock_picking;
delete from stock_move;
delete from account_invoice;
delete from account_partial_reconcile;
delete from account_move;
delete from sale_order;
delete from account_payment;

我现在面临的主要问题是在不删除产品的情况下将所有产品数量设置为0。我需要什么查询运行设置为重置它们并从头开始清点?

型号中的产品数量:

   stock.quant 

只要删除那些记录,产品应该是零。

试试这个:

   delete from stock_quant;

因为 odoo 将模型名称更改为有效的 postgres 名称 通过改变 .到 _

你可以试试:

UPDATE stock_quant SET qty=0;