Wash and clean the beans and cut them diagonally into pieces. Cook the beans in salted water for about 10 minutes, then rinse in cold water. Wash and clean the tomatoes and cut them into small pieces. Peel and finely chop the onion. Heat 1 tablespoon of oil in a pot and sauté the diced onion. Add the tomato paste and sauté.
Add tomatoes and stock and let simmer for about 8 minutes. Season the sauce with salt, pepper and some chilli. Wash the thyme and remove the leaves from 2 stems. Chop the thyme leaves coarsely and add to the sauce. Prepare gnocchi in boiling salted water according to the instructions on the packet. Heat 1 tablespoon of oil in a pan. Fry the gnocchi, beans and savory for 3-4 minutes and season with salt and pepper. Remove the savory. Add tomato sauce to the beans, bring to the boil and fill into an ovenproof dish. Halve the Parma ham and place it between the beans and gnocchi. Grate cheese and pour over the vegetables.
Heat 1 tablespoon of oil in a pan. Fry the gnocchi, beans and savory for 3-4 minutes and season with salt and pepper. Remove the savory. Add tomato sauce to the beans, bring to the boil and fill into an ovenproof dish. Halve the Parma ham and place it between the beans and gnocchi. Grate cheese and pour over the vegetables. Gratinate in a preheated oven (electric cooker: 225°C/ convection oven: 200°C/ gas: level 4) until the cheese is golden brown. Garnish gratin with thyme stems and coarse pepper and serve