Heat the oil in a large heavy frying pan over medium heat. Sauté onions until they start to brown. Add chicken pieces, and fry until lightly browned on the outside. Pour in the water, and bring to the boil. Reduce heat to low, and simmer for about 30 minutes, adding more water if necessary to keep the mixture from drying out.
Preheat the oven to 160 C. Combine the walnuts and pomegranate juice in the container of a mixie. Process into a purée. This can be done in small batches if necessary. Add this mixture to the simmering chicken mixture. Season with cardamom, cinnamon, saffron powder and salt. If using, stir in the cubed squash. Transfer the entire mixture to a 23x33cm (9x13 in) baking dish.
Bake loosely covered for 2 1/2 hours in the preheated oven. Serve with white rice.
You can use a variety of chicken pieces for this dish.