Exporting a shape made with modifier:boolean-difference
You need to apply the modifier first. Then you will have 1 shape. To do so you can either click Apply on the right in the Properties Tab or if you want to use python you can use bpy.ops.object.modifier_apply(apply_as='DATA', modifier='newTray'). But you need the object having the modifier selected for it to work. tray.select = True should do the trick. After that you'll still have to delete the object you subtracted from the other one (in your case trayCutout). To use python it's bpy.ops.object.delete(). Again, for it to work you need to select it first: trayCutout.select = True and deselect the other one tray.select = False.

So we have (if you want to delete trayCutout, otherwise you'll have to leave the last three lines out):

tray.select = True
bpy.ops.object.modifier_apply(apply_as='DATA', modifier='newTray')
trayCutout.select = True
tray.select = False
bpy.ops.object.delete()