odoo 清空业务数据


from sqlalchemy import create_engine

conn = create_engine('postgresql://odooshequ:odooshequ@127.0.0.1:5432/odooshequ')

tbs = ['account_move', 'account_move_line', 'account_move_reversal', 'mrp_production',
'mrp_production_backorder', 'mrp_production_backorder_line', 'mrp_workorder', 'purchase_order',
'purchase_order_line', 'sale_order', 'sale_order_line', 'stock_move', 'stock_move_line', 'stock_quant']

def remove_all_trans():
sql = '''delete from %s'''
for tb in tbs:
tmp = sql % tb
conn.execute(tmp)

posted @ 2023-08-12 09:13  CrossPython  阅读(240)  评论(0)    收藏  举报