Affiliation for publication
I think it is a common practice as your affiliation you use the one that you had during performing the work. This is especially true when you do not have new affiliation. For example, a PhD student that publishes his/her PhD paper while he/she is already two years into a postdoc. Many people will still leave the PhD affiliation, probably also add new one. Otherwise, it will look weird that affiliation of your and your advisor is different.