Preheat the oven to 350ºF and line a large rectangular baking dish (11x7-inch) with parchment paper. Finely dice the onion and finely chop the bacon.
Heat the butter in a frying pan over medium heat. Add the bacon and onion and cook, stirring regularly, until the onion softens and the bacon is golden. Remove from heat and allow to cool slightly.
Grate zucchini into a colander and sprinkle a little salt on top. Set aside.
In a large mixing bowl, add the bacon, onion, eggs, cheese, flour, and oil. Stir well to combine.
Using your hands, squeeze excess moisture out of the zucchini into the sink, then place into the mixing bowl and stir to combine—season with a little salt and pepper.
Pour the mixture into the prepared baking dish. Bake for 35-40 minutes, until cooked through and firm to touch. Allow to cool, then cut into squares to serve.