I agree that is the smell is only when flushing it could be your roof tank vent may be clogged &/or your tank needs to be thoroughly cleaned.
If you have a tank flushing system use it every time you dump until you get result. If you don't have this flushing system add some plain old blue Dawn (about 1/3 to 1/2 cup) fill the tank to almost completely full then take it for a drive or let it set unused for several hours. Then dump the tank and run water through the tank using water from a hose down the toilet or holding the flush lever until the water seems to run clearer. You may need to do this several times if there is a build-up.
As mentioned, always leave your black tank valve shut until it is quite full then dump and flush as needed. And fill the bowl with quite a bit of water to be sure there is more water in the tank than solids.
It can be very frustrating to ride down the road in an "outhouse". There are additives to help with the smell but some of those smell worse than what it's trying to cover up. Good luck!