BusinessTemplate: don't export in a different file for missing attribute case.
Only xml metadata should be exported in this case. In the previous version the check of hasattr could pass if attribute is defined as an attribute of the class and not of the instance, causing also AttributeError later when the code tries to invoke delattr.
Test also added.