def _get_text_amount(self, amount, currency_id):
        es_regex = re.compile('es.*')
        en_regex = re.compile('en.*')
        lang = self.localcontext.get('lang')
        if es_regex.match(lang):
            from openerp.addons.l10n_cr_amount_to_text import amount_to_text
            return amount_to_text.number_to_text_es(
                amount, '',
                join_dec=' Y ', separator=',', decimal_point='.')
        elif en_regex.match(lang):
            from openerp.tools import amount_to_text_en
            return amount_to_text_en.amount_to_text(
                amount, lang='en', currency='')
        else:
            raise Warning(_('Language not supported by this report.'))