Add item code manually or auto generated if item code not added

Hi!
I m trying to find a solution related to item code.
Here’s the case.
A user can manually add item code if they want otherwise item code should be auto added if not provided by the user.
I m using naming series for to generate item code but the problem is that if the user fill the item code the auto generated code is also getting combined with the item code.

What i want is if the user fill the item code and save then the naming series/auto-generated code should not be added to the user provided item code.

For ex:
user added item code LK.0033
so the item code should be only LK.0033
not combined with some random generated number like this LK.003300001 (LK.0022random-number)

Please give me some suggestion how i can achieve this and what i need to do to achieve this.

Thanks in advance