One thing causes odors in a dishwasher: rotting food particles. They can get stuck in the drain tube, collect in the bottom of the tub or adhere to the edges of the dishwasher door. Typically, not rinsing dishes before placing them in the dishwasher rack causes the buildup. Clogged sprayers may also decrease the pressure of the wash and rinse cycle, causing particles to remain in the tub once the cycle is complete.
Rotting food contains contaminants that will adhere to the rest of the dishes in the tub. They may not be visible, but they are there. The unpleasant smell is obviously undesirable, as is the visible buildup around the edges of the door and in the bottom of the tub. A clogged drain pipe will eventually back up, leaving standing water full of food particles in the bottom of the tub.
You can check the drain tube for a clog, as well as the bottom of the tub. There may be large particles of food in either location. You can wipe down the tub itself, the area around the door seal and the crack between the door and the tub. The next step is to poke a toothpick into the sprayer holes to remove any clogs and then run an empty load with plain soap or white vinegar to eradicate the odor.
The seal between the door and the tub should be cleaned regularly with either a soapy dish rag or a washcloth soaked in white vinegar. Any area containing buildup should also be cleaned, including the soap dispenser and the bottom of the door near the tub. The drain tube should also be checked regularly, and any debris removed promptly. You should also run an empty load once a month to clean the entire assembly.