diff --git a/addons/account_check_writing/account_voucher.py b/addons/account_check_writing/account_voucher.py index 7a5d12f5cff..f7b35dccacc 100644 --- a/addons/account_check_writing/account_voucher.py +++ b/addons/account_check_writing/account_voucher.py @@ -49,9 +49,21 @@ class account_voucher(osv.osv): if 'value' in default: amount = 'amount' in default['value'] and default['value']['amount'] or amount + # Currency complete name is not available in res.currency model + # Exceptions done here (EUR, USD, BRL) cover 75% of cases + # For other currencies, display the currency code + currency = self.pool['res.currency'].browse(cr, uid, currency_id, context=context) + if currency.name.upper() == 'EUR': + currency_name = 'Euro' + elif currency.name.upper() == 'USD': + currency_name = 'Dollars' + elif currency.name.upper() == 'BRL': + currency_name = 'reais' + else: + currency_name = currency.name #TODO : generic amount_to_text is not ready yet, otherwise language (and country) and currency can be passed #amount_in_word = amount_to_text(amount, context=context) - amount_in_word = amount_to_text(amount) + amount_in_word = amount_to_text(amount, currency=currency_name) default['value'].update({'amount_in_word':amount_in_word}) if journal_id: allow_check_writing = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context).allow_check_writing diff --git a/addons/account_check_writing/report/check_print.py b/addons/account_check_writing/report/check_print.py index 57360025623..add79fcc35a 100644 --- a/addons/account_check_writing/report/check_print.py +++ b/addons/account_check_writing/report/check_print.py @@ -34,7 +34,6 @@ class report_print_check(report_sxw.rml_parse): 'fill_stars' : self.fill_stars, }) def fill_stars(self, amount): - amount = amount.replace('Dollars','') if len(amount) < 100: stars = 100 - len(amount) return ' '.join([amount,'*'*stars])