We consider an inner product of a special type in the space of \(n\)-tuples over a finite field \({F}_q\), of characteristic \(p\). We prove that there is a very close relationship between the self-dual \(q\)-ary additive codes under this inner product and the self-dual \(p\)-ary codes under the usual dot product. We prove the MacWilliams identities for complete weight enumerators of \(q\)-ary additive codes with respect to the new inner product. We define a two-tuple weight enumerator of a binary self-dual code and prove that it is invariant of a group of order 384. We compute the Molien series of this group and find a good polynomial basis for the ring of its invariants.