Arnaud Pineux (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-1015867-api into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #1015867 in OpenERP Addons: "check writing amount in words always euro"
  https://bugs.launchpad.net/openobject-addons/+bug/1015867

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1015867-api/+merge/133958
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1015867-api/+merge/133958
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-1015867-api.
=== modified file 'account_check_writing/account_voucher.py'
--- account_check_writing/account_voucher.py	2012-09-20 09:27:26 +0000
+++ account_check_writing/account_voucher.py	2012-11-12 16:34:24 +0000
@@ -21,7 +21,7 @@
 
 from osv import osv,fields
 from tools.translate import _
-from tools.amount_to_text_en import amount_to_text
+from tools.amount_to_text import amount_to_text
 from lxml import etree
 
 class account_voucher(osv.osv):
@@ -51,7 +51,9 @@
 
             #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)
+            currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id
+            lang = self.pool.get('res.users').browse(cr, uid, uid, context=context).lang
+            amount_in_word = amount_to_text(amount, lang=lang[:2], 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

=== modified file 'account_check_writing/report/check_print.py'
--- account_check_writing/report/check_print.py	2012-10-02 14:09:05 +0000
+++ account_check_writing/report/check_print.py	2012-11-12 16:34:24 +0000
@@ -21,7 +21,7 @@
 
 import time
 from report import report_sxw
-from tools import amount_to_text_en
+from tools import amount_to_text
 
 class report_print_check(report_sxw.rml_parse):
     def __init__(self, cr, uid, name, context):

=== modified file 'account_voucher/report/account_voucher.py'
--- account_voucher/report/account_voucher.py	2012-10-02 10:29:15 +0000
+++ account_voucher/report/account_voucher.py	2012-11-12 16:34:24 +0000
@@ -21,7 +21,7 @@
 
 import time
 from report import report_sxw
-from tools import amount_to_text_en
+from tools import amount_to_text
 
 class report_voucher(report_sxw.rml_parse):
     def __init__(self, cr, uid, name, context):
@@ -36,7 +36,7 @@
         })
 
     def convert(self, amount, cur):
-        amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
+        amt_en = amount_to_text.amount_to_text(amount, 'en', cur)
         return amt_en
 
     def get_title(self, type):

=== modified file 'account_voucher/report/account_voucher_print.py'
--- account_voucher/report/account_voucher_print.py	2012-10-02 10:29:15 +0000
+++ account_voucher/report/account_voucher_print.py	2012-11-12 16:34:24 +0000
@@ -21,7 +21,7 @@
 
 import time
 from report import report_sxw
-from tools import amount_to_text_en
+from tools import amount_to_text
 
 class report_voucher_print(report_sxw.rml_parse):
     def __init__(self, cr, uid, name, context):
@@ -35,7 +35,7 @@
         })
 
     def convert(self, amount, cur):
-        amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
+        amt_en = amount_to_text.amount_to_text(amount, 'en', cur)
         return amt_en
 
     def get_lines(self, voucher):

=== modified file 'hr_payroll/report/report_payslip.py'
--- hr_payroll/report/report_payslip.py	2012-03-05 18:40:03 +0000
+++ hr_payroll/report/report_payslip.py	2012-11-12 16:34:24 +0000
@@ -23,7 +23,7 @@
 ##############################################################################
 
 from report import report_sxw
-from tools import amount_to_text_en
+from tools import amount_to_text
 
 class payslip_report(report_sxw.rml_parse):
 

=== modified file 'hr_payroll/report/report_payslip_details.py'
--- hr_payroll/report/report_payslip_details.py	2012-10-02 10:29:15 +0000
+++ hr_payroll/report/report_payslip_details.py	2012-11-12 16:34:24 +0000
@@ -23,7 +23,7 @@
 ##############################################################################
 
 from report import report_sxw
-from tools import amount_to_text_en
+from tools import amount_to_text
 
 class payslip_details_report(report_sxw.rml_parse):
 

=== modified file 'l10n_in_hr_payroll/report/report_payroll_advice.py'
--- l10n_in_hr_payroll/report/report_payroll_advice.py	2012-07-13 06:38:31 +0000
+++ l10n_in_hr_payroll/report/report_payroll_advice.py	2012-11-12 16:34:24 +0000
@@ -25,7 +25,7 @@
 from datetime import datetime
 
 from report import report_sxw
-from tools import amount_to_text_en
+from tools import amount_to_text
 
 class payroll_advice_report(report_sxw.rml_parse):
     
@@ -56,7 +56,7 @@
         return res
 
     def convert(self, amount, cur):
-        return amount_to_text_en.amount_to_text(amount, 'en', cur);
+        return amount_to_text.amount_to_text(amount, 'en', cur);
 
     def get_bysal_total(self):
         return self.total_bysal

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to