Not with opium smokers but I have some familiarity with opioid users and they are generally not good workers. Of course maybe there are tons of opioid users who pass as totally functional people and so I don't recognize them, but I doubt that. Marijuana is also clearly not addictive in the same way as opioids are (perhaps it is slightly addictive and maybe more so now that it has become stronger). It seems to be more like caffeine where its use is ritualized but people don't have a very hard time with cessation if forced to. I would bet daily users of cannabis are significantly less productive than the average population, but I know a couple in high performance jobs, so it's certainly not guaranteed.
I imagine in the China of the early 1900s many of the opium users did die just as many heroin/fentanyl users today do. I have talked to addicts who expect to die of their drug addiction and openly say so.
Edit: I thought about it a bit more and I am aware of some functional addicts addicted to (legally proscribed) pain meds. So I suppose it is possible opium users/addicts were more like this group. I doubt it though because China went to extreme lengths to eradicate opium from the country after the communists came to power.