Question: Let's say you had a doctoral student who you were main supervisor for {~advisor) throughout their data collection and most of their write-up, but just before they finished they changed to another main supervisor and you became deputy supervisor (you moved to a new institution in another country and they wanted someone close at hand). Let's say you then counted this student on your CV as supervised to completion as main supervisor because this is 90% true and because these CV points are important for things like promotion. The plan if anyone ever called you out on this would be to just explain the situation as it is and say that 90% of the work felt like it justified the claim. The student is in Sweden (where the regulations say students have the right to supervisor change without even having to make a case) and the supervisor is a Lecturer (~associate prof) at a UK university who wants to make Reader (~full prof) some day. Is this a bad idea? What is likely to go wrong?

Answer: 
On a generic CV, I would simply make a section of "Graduate students supervised and co-supervised", and include this student. In this context it wouldn't be necessary to go into detail about whether the supervision was "to completion".

But for something like a promotion dossier, where you're asked to tick boxes, I would go to whoever is responsible for overseeing the evaluation process (department head, promotion committee chair, etc), explain the situation, and ask what you should do. If at all possible, get an answer in writing. Then, when you fill out the form, attach a note saying something like:

> 
> One student was supervised by me for about 90% of their thesis work (stages X, Y, Z), and then changed supervisors for the last 10%; I am officially listed as their deputy supervisor. I spoke with Department Head Smith on October 24, 2018, and she advised that it was appropriate to include this student as "supervised to completion".
> 
> 
> 

If Smith says "no, don't count it", then you attach a similar note saying "Smith said not to include this student, but I believe that this is a similar accomplishment to supervising a student to completion".

Since academic achievement is generally self-reported and "honor system", this means that any attempt to "cheat" is seen as a serious ethical offense. If someone on the evaluation committee is hostile to you, they could use something like this as ammunition to wreck your entire promotion case. ("Candidate says supervised to completion, but student's dissertation shows someone else as supervisor. Clear-cut fraud.") So that's what could go wrong. But if you disclose the situation, and get someone else to pre-approve the way you're filling the form, you eliminate the possibility; maybe it won't be counted in your favor, but at least you can't be accused of fraud.
What could go wrong: 

1. You might not be given a chance to explain it.
2. Once someone realizes you fudged this detail a little, it might call all of the other details in your cv into question.