← Back to team overview

openerp-dutch team mailing list archive

[Merge] lp:~ludo-neobis/openobject-server/fix_for_bug_1180692 into lp:openobject-server/7.0

 

Ludo (Neobis) has proposed merging lp:~ludo-neobis/openobject-server/fix_for_bug_1180692 into lp:openobject-server/7.0.

Requested reviews:
  OpenERP Dutch Team - Nederland (openerp-dutch): code
Related bugs:
  Bug #1180692 in OpenERP Server: "Dutch version of amount_to_text incorrect"
  https://bugs.launchpad.net/openobject-server/+bug/1180692

For more details, see:
https://code.launchpad.net/~ludo-neobis/openobject-server/fix_for_bug_1180692/+merge/164097

Fix for bug 1180692, concerning the amount_to_text file from tools.

Please review.
-- 
https://code.launchpad.net/~ludo-neobis/openobject-server/fix_for_bug_1180692/+merge/164097
Your team OpenERP Dutch Team - Nederland is requested to review the proposed merge of lp:~ludo-neobis/openobject-server/fix_for_bug_1180692 into lp:openobject-server/7.0.
=== modified file 'openerp/tools/amount_to_text.py'
--- openerp/tools/amount_to_text.py	2012-12-14 13:44:55 +0000
+++ openerp/tools/amount_to_text.py	2013-05-16 09:01:27 +0000
@@ -92,15 +92,15 @@
 # Dutch
 #-------------------------------------------------------------
 
-to_19_nl = ( 'Nul',  'Een',   'Twee',  'Drie', 'Vier',   'Vijf',   'Zes',
-          'Zeven', 'Acht', 'Negen', 'Tien',   'Elf', 'Twaalf', 'Dertien',
-          'Veertien', 'Vijftien', 'Zestien', 'Zeventien', 'Achttien', 'Negentien' )
-tens_nl  = ( 'Twintig', 'Dertig', 'Veertig', 'Vijftig', 'Zestig', 'Zeventig', 'Tachtig', 'Negentig')
+to_19_nl = ( 'nul',  'een',   'twee',  'drie', 'vier',   'vijf',   'zes',
+          'zeven', 'acht', 'negen', 'tien',   'elf', 'twaalf', 'dertien',
+          'veertien', 'vijftien', 'zestien', 'zeventien', 'achttien', 'negentien' )
+tens_nl  = ( 'twintig', 'dertig', 'veertig', 'vijftig', 'zestig', 'zeventig', 'tachtig', 'negentig')
 denom_nl = ( '',
-          'Duizend', 'Miljoen', 'Miljard', 'Triljoen', 'Quadriljoen',
-           'Quintillion', 'Sextiljoen', 'Septillion', 'Octillion', 'Nonillion',
-           'Decillion', 'Undecillion', 'Duodecillion', 'Tredecillion', 'Quattuordecillion',
-           'Sexdecillion', 'Septendecillion', 'Octodecillion', 'Novemdecillion', 'Vigintillion' )
+          'duizend', ' miljoen', ' miljard', ' triljoen', ' quadriljoen',
+           ' quintillion', ' sextiljoen', ' septillion', ' octillion', ' nonillion',
+           ' decillion', ' undecillion', ' duodecillion', ' tredecillion', ' quattuordecillion',
+           ' sexdecillion', ' septendecillion', ' octodecillion', ' novemdecillion', ' vigintillion' )
 
 def _convert_nn_nl(val):
     """ convert a value < 100 to Dutch
@@ -110,7 +110,7 @@
     for (dcap, dval) in ((k, 20 + (10 * v)) for (v, k) in enumerate(tens_nl)):
         if dval + 10 > val:
             if val % 10:
-                return dcap + '-' + to_19_nl[val % 10]
+                return to_19_nl[val % 10] + 'en' + dcap
             return dcap
 
 def _convert_nnn_nl(val):
@@ -123,9 +123,7 @@
     word = ''
     (mod, rem) = (val % 100, val // 100)
     if rem > 0:
-        word = to_19_nl[rem] + ' Honderd'
-        if mod > 0:
-            word += ' '
+        word = to_19_nl[rem] + 'honderd'
     if mod > 0:
         word += _convert_nn_nl(mod)
     return word
@@ -140,9 +138,9 @@
             mod = 1000 ** didx
             l = val // mod
             r = val - (l * mod)
-            ret = _convert_nnn_nl(l) + ' ' + denom_nl[didx]
+            ret = _convert_nnn_nl(l) + denom_nl[didx]
             if r > 0:
-                ret = ret + ', ' + dutch_number(r)
+                ret = ret + ' ' + dutch_number(r)
             return ret
 
 def amount_to_text_nl(number, currency):
@@ -153,7 +151,7 @@
     end_word = dutch_number(int(list[1]))
     cents_number = int(list[1])
     cents_name = (cents_number > 1) and 'cent' or 'cent'
-    final_result = start_word +' '+units_name+' '+ end_word +' '+cents_name
+    final_result = " %s %s en %s %s" % (start_word, units_name, end_word, cents_name)
     return final_result
 
 #-------------------------------------------------------------


Follow ups