Fix bug in templates when update opposite properties of the same class

Change-Id: I119097fd92b3f80f643f7630411cfdd7d6390df5
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>