You must not accept any legacy, gift or other benefit under a will that you are asked to prepare. If a client indicates that they wish to leave you a gift or legacy, either the gift must not appear in the will or the matter must be referred immediately to a colleague and you must have no involvement in taking instructions for, advising on or drafting the relevant provisions.
Best practice in this situation would be to make a clear contemporaneous file note recording:
Particular care should be taken to avoid any appearance that you have influenced the client, encouraged the gift or benefited from your professional position. Even where a client insists that the gift reflects their genuine wishes, the matter should be handled transparently and independently.
There is a helpful Law Society note on this subject that is well worth a read.