Eating the chickens poop is harmless to dogs.  I would be surprised if that was the cause of the dogs upset stomach, unless it was gorging on piles of the stuff all day!
 
Poop is a natural part of a dogs diet in the 'wild'. They eat their puppies poop in the den to keep it clean.  They eat the poop of other animals as its got nutritional value for them.  The roll in stinky poop to disguise their dog smell for hunting.
 
The dog will not be 'missing something it its diet' causing it to eat the poop.  It will just eat it no matter how good the diet is.  The poop is just extra food to them.
 
Dog owners will regularly de worm their dogs as a matter of prevention, so even if the chicken poop had worms in it they will not affect the dog if its de worming is up to date.
 
I don't mind my dog eating the chicken poop as it help clear up the garden and I don't have to get the poop stuck to my shoes!
 
You will find that the dog will gradually eat less and less of the chicken poop over time, as the novelty wears off and it becomes bored with it.  Then it will look for something else nasty to eat!
 
Using 'shock collars' or 'muzzles that are taped up at the end', (as suggested by some people here) is not needed and, in my mind, a little extreme and cruel for the poor dog, which not doing anything bad, except making us feel a bit revolted.