[FIX] amount_to_text: avoid to have a none in the concat

bzr revid: stw@openerp.com-20120904100250-utk61q7ik41lameo
This commit is contained in:
Stephane Wirtel 2012-09-04 12:02:50 +02:00
parent 76772d06bf
commit 29b437766f
1 changed files with 2 additions and 2 deletions

View File

@ -88,8 +88,8 @@ def amount_to_text(number, currency):
end_word = english_number(int(list[1]))
cents_number = int(list[1])
cents_name = (cents_number > 1) and 'Cents' or 'Cent'
final_result = start_word +' '+units_name+' and ' + end_word +' '+cents_name
return final_result
return ' '.join(filter(None, [start_word, units_name, (start_word or units_name) and (end_word or cents_name) and 'and', end_word, cents_name]))
#-------------------------------------------------------------