From 29b437766f12fcff6463f5b8da19147ca941ae01 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 4 Sep 2012 12:02:50 +0200 Subject: [PATCH] [FIX] amount_to_text: avoid to have a none in the concat bzr revid: stw@openerp.com-20120904100250-utk61q7ik41lameo --- openerp/tools/amount_to_text_en.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/tools/amount_to_text_en.py b/openerp/tools/amount_to_text_en.py index 9a1ac939e6b..97d690c70e2 100644 --- a/openerp/tools/amount_to_text_en.py +++ b/openerp/tools/amount_to_text_en.py @@ -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])) #-------------------------------------------------------------