I've noticed the converse seems to be true in me, at least to a degree: getting useful work done causes me to feel happier. I have not noticed happiness causing me to get more useful work done.
I have noticed both, but happiness does seem to improve more after the start of useful work than useful work improves after an increase in happiness. I might describe it as certain types of work requiring a threshold level of happiness to initiate, among other requirements.
I've been noticing this tendency for years and trying to use it to my advantage (much to the annoyance of all the mainstream types who only inquire into my methods when they fail). A particular anecdote that comes to mind is how, after weeks of not managing to care enough to complete any...
If it's worth saying, but not worth its own post (even in Discussion), then it goes here.