ODOO的运行数据清空

 1 to_removes = [
 2         ['procurement.order',],
 3         ['purchase.order.line',],
 4         ['purchase.order',],
 5 
 6         ['stock.quant',],
 7         ['stock.move',],
 8         ['stock.pack.operation',],
 9         ['stock.picking',],
10         ['stock.inventory.line',],
11         ['stock.inventory',],
12         ['stock.quant.package',],
13         ['stock.quant.move.rel',],
14         ['stock.production.lot',],
15         ['stock.fixed.putaway.strat',],
16         ['mrp.production.workcenter.line',],
17         ['mrp.production',],
18         ['mrp.production.product.line',],
19         ['sale.order.line',],
20         ['sale.order',],
21         ['pos.order.line',],
22         ['pos.order',],
23 
24         ['account.voucher.line',],
25         ['account.voucher',],
26         ['account.invoice',],
27         ['account.partial.reconcile',],
28         ['account.move',],
29 ]
30 
31 def remove_data(cr):
32         try:
33             for line in to_removes :
34                 obj_name = line[0]
35                 obj = self.pool.get(obj_name)
36                 if obj and obj._table_exist:
37                     sql = "delete from %s" % obj._table
38                     cr.execute( sql)
39 
40 
41         except Exception, e:
42             raise Warning(e)
43 
44         return True
45 
46 remove_data(cr,)

在PostgreSQL里选择sale_order,purchase_order,stock_move,stock_picking,stock_quant做一下级联清空。感觉所有销售,采购,生产里的运行数据就没有了。

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值