^It may be more common than you think.
That said, just as when prescribed a stimulant, opiates can seem like a panacea. That is, until tolerance develops.
In totality, from what I've read, drugs which force happiness, whether opiates, stimulants, or even benzos in some cases, tend to produce a very small benefit on depression if used long-term. That said, the delta subtype of the opiate receptor is supposed to be a valid target for treating depression (it's mu-agonism which produces euphoria). It appears that some medications, including venlafaxine and clozapine, act partially on this subtype. If one can not raise their dose of whatever opiate they're on, in theory, an antidepressant effect would manifest without too much danger of addiction. But of course, it takes a lot of willpower for one not to do that, and those with depression generally don't have that kind of control over their passions, which abuse led to opiates being phased out as psychiatric medications (by-and-large) in the 1950's.
buprenorphine and tramadol may be the most likely opioids to help depression.