Does that violate the perfect secrecy in any way?
Yes, obviously. Restricting the message space doesn't hurt in any way (the attacker can't get any additional information about the message, even if he knows quite a lot about it already); restricting the key does.
OTP uses a group operation to combine the message and the key; one thing that it needs to assume is that the group members that make up the key are chosen uniformly randomly from all possible group elements - with your example, this is not the case.
Specifically, if we see in the ciphertext the value 0111
, we can deduce from that is that the corresponding plaintext value is not 0000
; after all, for that to be the case, the key value would have been 0111
, and we know that's not the case. That are values that the attacker can deduce are not the message, and this is a violation of perfect secrecy.
Now, if you did have the message and key consisting of values from 0 to 6, the obvious thing to do is change the group operation to 'addition modulo 7'; that is, to encrypt, you add the message to the key, and then if that value is 7 or more, subtract 7 - that gives you the ciphertext. And, to decrypt, you do 'subtraction modulo 7'; you subtract the key from the ciphertext, and if that value is negative, add 7. This is a perfectly valid group operation, and since all values of the key are possible (and presumably equiprobable), it can satisfy the requirements of perfect secrecy.