def _get_pain_def(self, country_code): ''' Get the right message definition based on country code of selected company bank (via payment mode) if no country is defined, take the company country - Here we could add a second level for bank definitions''' if country_code: class_name = 'pain.001' + '.' + country_code.lower() if MsgSEPAFactory.has_instance(class_name): return MsgSEPAFactory.get_instance(class_name) return MsgSEPAFactory.get_instance('pain.001')