The account_financial_report_webkit module does not work well with OpenERP 7.0.
When trying to generate a General Ledger report, I get the following error:
---------------------------------------
2013-02-19 06:25:01,448 17843 ERROR ? openerp.service.web_services: Exception: coercing to Unicode: need string or buffer, bool found
Traceback (most recent call last):
File "/opt/openerp/7.0/server/openerp/service/web_services.py", line 700, in go
(result, format) = obj.create(cr, uid, ids, datas, context)
File "/opt/openerp/7.0/addons/report_webkit/webkit_report.py", line 333, in create
result = self.create_source_pdf(cursor, uid, ids, data, report_xml, context)
File "/opt/openerp/7.0/server/openerp/report/report_sxw.py", line 513, in create_source_pdf
return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
File "/opt/openerp/7.0/community/account-financial-report/account_financial_report_webkit/report/webkit_parser_header_fix.py", line 171, in create_single_pdf
if os.path.exists(path) :
File "/usr/lib/python2.6/genericpath.py", line 18, in exists
st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, bool found
2013-02-19 06:25:01,669 17843 ERROR None openerp.netsvc: coercing to Unicode: need string or buffer, bool found
(<type 'exceptions.TypeError'>, TypeError('coercing to Unicode: need string or buffer, bool found',), <traceback object at 0x4a2b3b0>)
Traceback (most recent call last):
File "/opt/openerp/7.0/server/openerp/netsvc.py", line 295, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/openerp/7.0/server/openerp/service/web_services.py", line 642, in dispatch
res = fn(db, uid, *params)
File "/opt/openerp/7.0/server/openerp/service/web_services.py", line 748, in exp_report_get
return self._check_report(report_id)
File "/opt/openerp/7.0/server/openerp/service/web_services.py", line 726, in _check_report
netsvc.abort_response(exc, exc.message, 'warning', exc.traceback)
File "/opt/openerp/7.0/server/openerp/netsvc.py", line 72, in abort_response
raise openerp.osv.osv.except_osv(description, details)
except_osv: (u'coercing to Unicode: need string or buffer, bool found', (<type 'exceptions.TypeError'>, TypeError('coercing to Unicode: need string or buffer, bool found',), <traceback object at 0x4a2b3b0>))
---------------------------------------
After looking closely, I found out that line 170 in account_financial_report_webkit/report/webkit_parser_header_fix.py is:
path =openerp.addons.get_module_resource(report_xml.report_file)
After looking around a bit, I found this page (http://bazaar.launchpad.net/~openerp-dev/openobject-addons/trunk-6.1-fwdport-odo/revision/8178) which suggests replacing this line with:
path =openerp.addons.get_module_resource(*report_xml.report_file.split(os.path.sep))
This change fixed the error show above, but then another error was raised:
---------------------------------------
2013-02-19 06:51:05,770 23559 WARNING ? openerp.osv.orm.browse_record.res.users: Field 'context_lang' does not exist in object 'browse_record(res.users, 1)'
2013-02-19 06:51:05,842 23559 ERROR ? financial.reports.webkit:
Traceback (most recent call last):
File "/opt/openerp/7.0/community/account-financial-report/account_financial_report_webkit/report/webkit_parser_header_fix.py", line 211, in create_single_pdf
**self.parser_instance.localcontext)
File "/usr/lib/pymodules/python2.6/mako/template.py", line 189, in render
return runtime._render(self, self.callable_, args, data)
File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 403, in _render
_render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data))
File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 434, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 457, in _exec_template
callable_(context, *args, **kwargs)
File "memory:0x6093c50", line 19, in render_body
<%setLang(user.context_lang)%>
File "/opt/openerp/7.0/server/openerp/osv/orm.py", line 486, in __getattr__
raise AttributeError(e)
AttributeError: "Field 'context_lang' does not exist in object 'browse_record(res.users, 1)'"
2013-02-19 06:51:05,843 23559 ERROR ? openerp.service.web_services: Exception: (u'Webkit render', '\n\nTraceback (most recent call last):\n File "/opt/openerp/7.0/community/account-financial-report/account_financial_report_webkit/report/webkit_parser_header_fix.py", line 211, in create_single_pdf\n **self.parser_instance.localcontext)\n File "/usr/lib/pymodules/python2.6/mako/template.py", line 189, in render\n return runtime._render(self, self.callable_, args, data)\n File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 403, in _render\n _render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data))\n File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 434, in _render_context\n _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)\n File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 457, in _exec_template\n callable_(context, *args, **kwargs)\n File "memory:0x6093c50", line 19, in render_body\n <%setLang(user.context_lang)%>\n File "/opt/openerp/7.0/server/openerp/osv/orm.py", line 486, in __getattr__\n raise AttributeError(e)\nAttributeError: "Field \'context_lang\' does not exist in object \'browse_record(res.users, 1)\'"\n')
Traceback (most recent call last):
File "/opt/openerp/7.0/server/openerp/service/web_services.py", line 700, in go
(result, format) = obj.create(cr, uid, ids, datas, context)
File "/opt/openerp/7.0/addons/report_webkit/webkit_report.py", line 333, in create
result = self.create_source_pdf(cursor, uid, ids, data, report_xml, context)
File "/opt/openerp/7.0/server/openerp/report/report_sxw.py", line 513, in create_source_pdf
return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
File "/opt/openerp/7.0/community/account-financial-report/account_financial_report_webkit/report/webkit_parser_header_fix.py", line 216, in create_single_pdf
raise except_osv(_('Webkit render'), msg)
except_osv: (u'Webkit render', '\n\nTraceback (most recent call last):\n File "/opt/openerp/7.0/community/account-financial-report/account_financial_report_webkit/report/webkit_parser_header_fix.py", line 211, in create_single_pdf\n **self.parser_instance.localcontext)\n File "/usr/lib/pymodules/python2.6/mako/template.py", line 189, in render\n return runtime._render(self, self.callable_, args, data)\n File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 403, in _render\n _render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data))\n File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 434, in _render_context\n _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)\n File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 457, in _exec_template\n callable_(context, *args, **kwargs)\n File "memory:0x6093c50", line 19, in render_body\n <%setLang(user.context_lang)%>\n File "/opt/openerp/7.0/server/openerp/osv/orm.py", line 486, in __getattr__\n raise AttributeError(e)\nAttributeError: "Field \'context_lang\' does not exist in object \'browse_record(res.users, 1)\'"\n')
2013-02-19 06:51:06,067 23559 ERROR None openerp.netsvc: Webkit render
Traceback (most recent call last):
File "/opt/openerp/7.0/community/account-financial-report/account_financial_report_webkit/report/webkit_parser_header_fix.py", line 211, in create_single_pdf
**self.parser_instance.localcontext)
File "/usr/lib/pymodules/python2.6/mako/template.py", line 189, in render
return runtime._render(self, self.callable_, args, data)
File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 403, in _render
_render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data))
File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 434, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 457, in _exec_template
callable_(context, *args, **kwargs)
File "memory:0x6093c50", line 19, in render_body
<%setLang(user.context_lang)%>
File "/opt/openerp/7.0/server/openerp/osv/orm.py", line 486, in __getattr__
raise AttributeError(e)
AttributeError: "Field 'context_lang' does not exist in object 'browse_record(res.users, 1)'"
Traceback (most recent call last):
File "/opt/openerp/7.0/server/openerp/netsvc.py", line 295, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/openerp/7.0/server/openerp/service/web_services.py", line 642, in dispatch
res = fn(db, uid, *params)
File "/opt/openerp/7.0/server/openerp/service/web_services.py", line 748, in exp_report_get
return self._check_report(report_id)
File "/opt/openerp/7.0/server/openerp/service/web_services.py", line 726, in _check_report
netsvc.abort_response(exc, exc.message, 'warning', exc.traceback)
File "/opt/openerp/7.0/server/openerp/netsvc.py", line 72, in abort_response
raise openerp.osv.osv.except_osv(description, details)
except_osv: (u'Webkit render', u'\n\nTraceback (most recent call last):\n File "/opt/openerp/7.0/community/account-financial-report/account_financial_report_webkit/report/webkit_parser_header_fix.py", line 211, in create_single_pdf\n **self.parser_instance.localcontext)\n File "/usr/lib/pymodules/python2.6/mako/template.py", line 189, in render\n return runtime._render(self, self.callable_, args, data)\n File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 403, in _render\n _render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data))\n File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 434, in _render_context\n _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)\n File "/usr/lib/pymodules/python2.6/mako/runtime.py", line 457, in _exec_template\n callable_(context, *args, **kwargs)\n File "memory:0x6093c50", line 19, in render_body\n <%setLang(user.context_lang)%>\n File "/opt/openerp/7.0/server/openerp/osv/orm.py", line 486, in __getattr__\n raise AttributeError(e)\nAttributeError: "Field \'context_lang\' does not exist in object \'browse_record(res.users, 1)\'"\n')
---------------------------------------
Is account_financial_report_webkit known not to work with 7.0?
Is this the current project, or is there a more recent version somewhere else?
In the mako template files:
- <%setLang( user.context_ lang)%> user.context. lang)%>
+ <%setLang(
seems to fix the last error in the original report.
On to the next error:
------- ------- ------- ------- ------- ---- 7.0/server/ openerp/ osv/osv. py", line 123, in wrapper 7.0/server/ openerp/ osv/osv. py", line 179, in execute 7.0/server/ openerp/ osv/osv. py", line 166, in execute_cr 7.0/addons/ account/ wizard/ account_ report_ common. py", line 172, in check_report ------- ------- ------- ------- ----
Uncaught exception
Traceback (most recent call last):
File "/opt/openerp/
return f(self, dbname, *args, **kwargs)
File "/opt/openerp/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/opt/openerp/
return getattr(object, method)(cr, uid, *args, **kw)
File "/opt/openerp/
data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id', 'target_move'], context=context)[0]
IndexError: list index out of range
-------