Skip to Content
Menu
This question has been flagged
7 Replies
17070 Views

Hello,

I have created a sales report with OpenOffice Report Designer and uploaded it to the server. When choosing this template in the "Print" menu, I get this error message:

OpenERP Client Error - Uncaught SyntaxError: Unexpected end of input

-----------------------------------------------------------------------------------------------------------------------------------------------

http://192.168.0.7:8069/?ts=1409059791570#id=4&view_type=form&model=sale.order&action=348:0

 

Could anyone tell me what this error exactly means? Could there anything be not right with the python syntax?

 

Greetings and thanks in advance.

Michael

Avatar
Discard
Best Answer

If you haven't installed "wkhtmltopdf" it'll throw an error like this.

I have also faced the same error and I resolved it after installing wkhtmltopdf

Open Terminal and install:

sudo apt-get install wkhtmltopdf

Then  try it, report will be generated and PDF will get downloaded.

Avatar
Discard
Best Answer

If anyone is still wondering how to fix it:

Step 1: As Tintu said, please check if you have wkhtmltopdf installed. 

Else install it using: sudo apt-get install wkhtmltopdf

If that doesn't fix the problem:

Step 2: Please check the web.base.url paramter in Settings>>Parameters>> Sytem Parameters
And confirm it with the ip/domain of your server on which your odoo is running.

Once done. you should be able to print/ download the documents. Hope it helps. Thanks.



Avatar
Discard
Best Answer

This could currently be any syntax error. Have you got the stacktrace from the logs? Might be easier to track down the error using those logs.

Avatar
Discard
Author Best Answer

Hello Ludo,

the log file states a lot of errors of this types:

2014-09-09 09:37:06,801 24234 ERROR ubisys openerp.tools.safe_eval: Cannot eval "not show_discount(user.id) and removeParentNode('para')"
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/tools/safe_eval.py", line 285, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
NameError: name 'show_discount' is not defined

 

2014-09-09 09:37:06,801 24234 WARNING ubisys openerp.report.render.rml2pdf.utils: rml_except: "not show_discount(user.id) and removeParentNode('para')"
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/report/render/rml2pdf/utils.py", line 76, in _child_get
    eval(n.get('rml_except'), {}, self.localcontext)
  File "/usr/lib/pymodules/python2.7/openerp/tools/safe_eval.py", line 285, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
NameError: name 'show_discount' is not defined

 

2014-09-09 09:37:06,816 24234 ERROR ubisys openerp.tools.safe_eval: Cannot eval "show_discount(user.id) and formatLang(line.discount, digits=get_digits(dp='Discount')) or ''"
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/tools/safe_eval.py", line 285, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
NameError: name 'show_discount' is not defin

 

2014-09-09 09:37:06,905 24234 ERROR ubisys openerp.service.web_services: Exception: can't find frame('Firmendaten') in <reportlab.platypus.doctemplate.PageTemplate instance at 0x7fd668ed1cb0>(None) which has frames [(<reportlab.platypus.frames.Frame instance at 0x7fd668ed15a8>, u'first')]
handle_currentFrame args=('Firmendaten', 0)
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/report/report_sxw.py", line 442, in create
    fnct_ret = fnct(cr, uid, ids, data, report_xml, context)
  File "/usr/lib/pymodules/python2.7/openerp/report/report_sxw.py", line 511, in create_source_pdf
    return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
  File "/usr/lib/pymodules/python2.7/openerp/report/report_sxw.py", line 533, in create_single_pdf
    pdf = create_doc(etree.tostring(processed_rml),rml_parser.localcontext,logo,title.encode('utf8'))
  File "/usr/lib/pymodules/python2.7/openerp/report/interface.py", line 206, in create_pdf
    obj.render()
  File "/usr/lib/pymodules/python2.7/openerp/report/render/render.py", line 59, in render
    self._result = self._render()
  File "/usr/lib/pymodules/python2.7/openerp/report/render/rml.py", line 41, in _render
    return rml2pdf.parseNode(self.rml, self.localcontext, images=self.bin_datas, path=self.path,title=self.title)
  File "/usr/lib/pymodules/python2.7/openerp/report/render/rml2pdf/trml2pdf.py", line 1032, in parseNode
    r.render(fp)
  File "/usr/lib/pymodules/python2.7/openerp/report/render/rml2pdf/trml2pdf.py", line 328, in render
    pt_obj.render(el)
  File "/usr/lib/pymodules/python2.7/openerp/report/render/rml2pdf/trml2pdf.py", line 1012, in render
    self.doc_tmpl.build(fis)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 890, in build
    self.handle_flowable(flowables)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 767, in handle_flowable
    f.apply(self)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 145, in apply
    annotateException("\nhandle_%s args=%s"%(action,ascii(args)))
  File "/usr/lib/python2.7/dist-packages/reportlab/lib/utils.py", line 1337, in annotateException
    rl_reraise(t,v,b)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 138, in apply
    getattr(doc,arn)(*args)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 686, in handle_currentFrame
    self.handle_nextFrame(fx,resume)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 678, in handle_nextFrame
    raise ValueError("can't find frame('%s') in %r(%s) which has frames %r"%(fx,self.pageTemplate,self.pageTemplate.id,[(f,f.id) for f in self.pageTemplate.frames]))
ValueError: can't find frame('Firmendaten') in <reportlab.platypus.doctemplate.PageTemplate instance at 0x7fd668ed1cb0>(None) which has frames [(<reportlab.platypus.frames.Frame instance at 0x7fd668ed15a8>, u'first')]
handle_currentFrame args=('Firmendaten', 0)

 

Avatar
Discard
Author

I think I got this problem solved. There's been a frame in my document, that OO had obviously problems to handle with. I moved the frame content into a table instead, and now I can print the report.

Looks like it from the logs as well. Glad to hear you solved it!

Best Answer

hello,

when i want to print a client interface with another option by using jasper report(model res partner) i found this error

Odoo Erreur (côté interface)

Uncaught SyntaxError: Unexpected end of input

http://localhost:8069/web#id=7&view_type=form&model=res.partner&menu_id=193&action=61:0

can you help me.thnks

Avatar
Discard
Related Posts Replies Views Activity
1
Jun 16
3282
8
May 25
42468
0
Mar 23
1932
1
Aug 22
1946
1
Mar 21
4447