任何人都可以向我解释如何将DINO作为货币将AMOUNT转换为FRENCH LETTERS。 事实上,我试过了,这个:
from openerp.report import report_sxw
from openerp.tools import amount_to_text_en
from openerp.tools import amount_to_text
import time
import datetime
from datetime import date
from datetime import datetime, date, time
class declaration_cnss(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
print ('----------------------test--------------------------')
super(declaration_cnss, self).__init__(cr, uid, name, context)
self.localcontext.update({
'get_employee_lines': self.get_employee_lines,
'amount_to_text': amount_to_text,
'amount_to_text_en': amount_to_text_en
})
在我的功能中我有这个: amount_in_word = amount_to_text(somme_brut,lang =' fr',currency =' dinars') 但我收到了警告:
2016-01-04 16:02:08,445 14045 WARNING ODOO
openerp.tools.amount_to_text_en: no translation function found for lang: 'fr'
金额转换为英文字母。 任何人都可以帮忙。
最诚挚的问候。
答案 0 :(得分:0)
您需要使用amount_to_text_fr
。
替换:
from openerp.tools import amount_to_text
使用:
from openerp.tools.amount_to_text import amount_to_text_fr
然后使用:
调用它amount_in_word = amount_to_text_fr(somme_brut, 'dinars')