from sqlalchemy import create_engine
conn = create_engine('postgresql://odooshequ:[email protected]: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)