"float argument required, not unicode" when discount on invoice

Bug #1202420 reported by Kyle Krenzer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
extra-aeroo-reports
New
Undecided
Unassigned

Bug Description

I have installed the account_layout_invoice module and the invoice layout report is working when the invoice is without discount. However, when there is a discount on the invoice I get the following pop up with error:

Internal Server Error
{"message": "OpenERP Server Error", "code": 200, "data": {"debug": "Server \nClient Traceback (most recent call last):\n File \"/usr/lib/pymodules/python2.7/openerp/addons/web/http.py\", line 285, in dispatch\n r = method(self, **self.params)\n File \"/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py\", line 1740, in index\n req.session._db, req.session._uid, req.session._password, report_id)\n File \"/usr/lib/pymodules/python2.7/openerp/addons/web/session.py\", line 30, in proxy_method\n result = self.session.send(self.service_name, method, *args)\n File \"/usr/lib/pymodules/python2.7/openerp/addons/web/session.py\", line 91, in send\n raise xmlrpclib.Fault(code_string % (e.name, e.value), '')\nFault: <Fault warning -- Aeroo Reports: Error while generating the report.\nfloat argument required, not unicode\nfloat argument required, not unicode\nFor more reference inspect error logs.\n\n(<type 'exceptions.Exception'>, Exception('Aeroo Reports: Error while generating the report.', TypeError('float argument required, not unicode',), 'float argument required, not unicode', 'For more reference inspect error logs.'), <traceback object at 0x7f960fad1f38>): ''>\n", "fault_code": "warning -- Aeroo Reports: Error while generating the report.\nfloat argument required, not unicode\nfloat argument required, not unicode\nFor more reference inspect error logs.\n\n(<type 'exceptions.Exception'>, Exception('Aeroo Reports: Error while generating the report.', TypeError('float argument required, not unicode',), 'float argument required, not unicode', 'For more reference inspect error logs.'), <traceback object at 0x7f960fad1f38>)", "type": "server_exception"}}

the log file:

2013-07-17 22:41:42,643 6872 INFO elevationorganics openerp.addons.report_aeroo.report_aeroo: Start process report.account.invoice.aeroo.test (account.invoice)
None
2013-07-17 22:41:42,966 6872 ERROR elevationorganics openerp.addons.report_aeroo.report_aeroo: Report generation error!
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/addons/report_aeroo/report_aeroo.py", line 529, in create_aeroo_report
    data = basic.generate(**oo_parser.localcontext).render().getvalue()
  File "/usr/local/lib/python2.7/dist-packages/aeroolib-1.2.0-py2.7.egg/aeroolib/plugins/base.py", line 51, in render
    return self.serializer(self.events)
  File "/usr/local/lib/python2.7/dist-packages/aeroolib-1.2.0-py2.7.egg/aeroolib/plugins/opendocument.py", line 1209, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/template/base.py", line 605, in _include
    for event in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/template/markup.py", line 327, in _match
    for event in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/template/base.py", line 565, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "/usr/lib/python2.7/dist-packages/genshi/template/base.py", line 277, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/usr/lib/python2.7/dist-packages/genshi/template/eval.py", line 178, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "<string>", line 2, in <Expression u'__filter(formatLang(line.price_subtotal))'>
  File "/usr/lib/pymodules/python2.7/openerp/report/report_sxw.py", line 317, in formatLang
    res = self.lang_dict['lang_obj'].format('%.' + str(digits) + 'f', value, grouping=grouping, monetary=monetary)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/addons/base/res/res_lang.py", line 204, in format
    formatted = percent % value
TypeError: float argument required, not unicode
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/addons/report_aeroo/report_aeroo.py", line 529, in create_aeroo_report
    data = basic.generate(**oo_parser.localcontext).render().getvalue()
  File "/usr/local/lib/python2.7/dist-packages/aeroolib-1.2.0-py2.7.egg/aeroolib/plugins/base.py", line 51, in render
    return self.serializer(self.events)
  File "/usr/local/lib/python2.7/dist-packages/aeroolib-1.2.0-py2.7.egg/aeroolib/plugins/opendocument.py", line 1209, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/template/base.py", line 605, in _include
    for event in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/template/markup.py", line 327, in _match
    for event in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/template/base.py", line 565, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "/usr/lib/python2.7/dist-packages/genshi/template/base.py", line 277, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/usr/lib/python2.7/dist-packages/genshi/template/eval.py", line 178, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "<string>", line 2, in <Expression u'__filter(formatLang(line.price_subtotal))'>
  File "/usr/lib/pymodules/python2.7/openerp/report/report_sxw.py", line 317, in formatLang
    res = self.lang_dict['lang_obj'].format('%.' + str(digits) + 'f', value, grouping=grouping, monetary=monetary)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/addons/base/res/res_lang.py", line 204, in format
    formatted = percent % value
TypeError: float argument required, not unicode
2013-07-17 22:41:42,967 6872 ERROR elevationorganics openerp.service.web_services: Exception: ('Aeroo Reports: Error while generating the report.', TypeError('float argument required, not unicode',), 'float argument required, not unicode', 'For more reference inspect error logs.')
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 712, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/usr/lib/pymodules/python2.7/openerp/addons/report_aeroo/report_aeroo.py", line 820, in create
    return fnct(cr, uid, ids, data, report_xml, context)
  File "/usr/lib/pymodules/python2.7/openerp/addons/report_aeroo/report_aeroo.py", line 675, in create_source_pdf
    return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
  File "/usr/lib/pymodules/python2.7/openerp/addons/report_aeroo/report_aeroo.py", line 580, in create_single_pdf
    return self.create_aeroo_report(cr, uid, ids, data, report_xml, context=context, output=output)
  File "/usr/lib/pymodules/python2.7/openerp/addons/report_aeroo/report_aeroo.py", line 533, in create_aeroo_report
    self._raise_exception(e, print_id)
  File "/usr/lib/pymodules/python2.7/openerp/addons/report_aeroo/report_aeroo.py", line 433, in _raise_exception
    raise Exception(_("Aeroo Reports: Error while generating the report."), e, str(e), _("For more reference inspect error logs."))
Exception: ('Aeroo Reports: Error while generating the report.', TypeError('float argument required, not unicode',), 'float argument required, not unicode', 'For more reference inspect error logs.')
2013-07-17 22:41:43,158 6872 ERROR elevationorganics openerp.netsvc: Aeroo Reports: Error while generating the report.
float argument required, not unicode
float argument required, not unicode
For more reference inspect error logs.
(<type 'exceptions.Exception'>, Exception('Aeroo Reports: Error while generating the report.', TypeError('float argument required, not unicode',), 'float argument required, not unicode', 'For more reference inspect error logs.'), <traceback object at 0x7f960fad1f38>)
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 654, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 760, in exp_report_get
    return self._check_report(report_id)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 738, in _check_report
    netsvc.abort_response(exc, exc.message, 'warning', exc.traceback)
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 71, in abort_response
    raise openerp.osv.osv.except_osv(description, details)
except_osv: (u'Aeroo Reports: Error while generating the report.\nfloat argument required, not unicode\nfloat argument required, not unicode\nFor more reference inspect error logs.', (<type 'exceptions.Exception'>, Exception('Aeroo Reports: Error while generating the report.', TypeError('float argument required, not unicode',), 'float argument required, not unicode', 'For more reference inspect error logs.'), <traceback object at 0x7f960fad1f38>))
2013-07-17 22:41:43,160 6872 INFO elevationorganics werkzeug: 127.0.0.1 - - [17/Jul/2013 22:41:43] "GET /web/report?action=%7B%22parser_loc%22%3A%22account_invoice_layout%2Freport%2Freport_account_invoice_layout.py%22%2C%22xml_id%22%3Afalse%2C%22help%22%3Afalse%2C%22report_rml_content%22%3Afalse%2C%22groups_id%22%3A%5B%5D%2C%22deferred_limit%22%3A80%2C%22stylesheet_id%22%3Afalse%2C%22copies%22%3A1%2C%22header%22%3Atrue%2C%22tml_source%22%3A%22database%22%2C%22report_type%22%3A%22aeroo%22%2C%22report_sxw%22%3Afalse%2C%22report_rml_content_data%22%3Afalse%2C%22replace_report_id%22%3Afalse%2C%22id%22%3A688%2C%22out_format%22%3A%5B4%2C%22PDF+-+Portable+Document+Format+(.pdf)%22%5D%2C%22charset%22%3A%22utf_8%22%2C%22report_wizard%22%3Afalse%2C%22parser_def%22%3A%22class+Parser(report_sxw.rml_parse)%3A%5Cn++++def+__init__(self%2C+cr%2C+uid%2C+name%2C+context)%3A%5Cn++++++++super(Parser%2C+self).__init__(cr%2C+uid%2C+name%2C+context)%5Cn++++++++self.context+%3D+context%5Cn++++++++self.localcontext.update(%7B%7D)%22%2C%22parser_state%22%3A%22loc%22%2C%22attachment%22%3Afalse%2C%22usage%22%3Afalse%2C%22report_sxw_content_data%22%3A%22591.31+Kb%22%2C%22type%22%3A%22ir.actions.report.xml%22%2C%22report_xml%22%3Afalse%2C%22fallback_false%22%3Afalse%2C%22content_fname%22%3Afalse%2C%22in_format%22%3A%22oo-odt%22%2C%22auto%22%3Afalse%2C%22styles_mode%22%3A%22default%22%2C%22wizard_id%22%3Afalse%2C%22active%22%3Atrue%2C%22report_sxw_content%22%3A%229.00+bytes%22%2C%22name%22%3A%22test+invoice%22%2C%22report_file%22%3Afalse%2C%22multi%22%3Afalse%2C%22preload_mode%22%3A%22static%22%2C%22report_xsl%22%3Afalse%2C%22process_sep%22%3Afalse%2C%22report_rml%22%3Afalse%2C%22report_name%22%3A%22account.invoice.aeroo.test%22%2C%22deferred%22%3A%22off%22%2C%22extras%22%3A%22aeroo_ooo%22%2C%22flags%22%3A%7B%22new_window%22%3Atrue%2C%22views_switcher%22%3Atrue%2C%22search_view%22%3Atrue%2C%22action_buttons%22%3Atrue%2C%22sidebar%22%3Atrue%2C%22pager%22%3Atrue%2C%22display_title%22%3Atrue%2C%22search_disable_custom_filters%22%3Atrue%7D%2C%22attachment_use%22%3Afalse%2C%22model%22%3A%22account.invoice%22%2C%22context%22%3A%7B%22lang%22%3A%22en_US%22%2C%22tz%22%3A%22US%2FPacific%22%2C%22uid%22%3A1%2C%22active_id%22%3A153%2C%22active_ids%22%3A%5B153%5D%2C%22active_model%22%3A%22account.invoice%22%2C%22search_disable_custom_filters%22%3Atrue%7D%2C%22menu_id%22%3Anull%7D&token=1374100902598&session_id=5356076a99854d40b84079077c4e753a HTTP/1.1" 500 -

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.