JayVora-SerpentCS / Jasperreports_odoo

Jasper Reports Engine for Odoo
http://www.serpentcs.com
81 stars 144 forks source link

[11.0] errors printing demo reports #43

Closed dcorio closed 6 years ago

dcorio commented 6 years ago

Trying to print one of the demo reports i get the following error:

Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://localhost:8069" from accessing a cross-origin frame.

http://localhost:8069/web/static/src/js/core/ajax.js:261
Traceback:
Error: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://localhost:8069" from accessing a cross-origin frame.
    at HTMLIFrameElement.<anonymous> (http://localhost:8069/web/static/src/js/core/ajax.js:261:37)
    at HTMLIFrameElement.dispatch (http://localhost:8069/web/static/lib/jquery/jquery.js:4641:58)
    at HTMLIFrameElement.elemData.handle (http://localhost:8069/web/static/lib/jquery/jquery.js:4309:63)

in the server log i see:

2018-03-26 13:29:09,086 1 INFO mydb odoo.addons.jasper_reports.jasper_report: Requested report: '/opt/odoo/community_addons/bundles/jasper_reports/jasper_reports/custom_reports/Quotation.jrxml'
2018-03-26 13:29:09,098 1 INFO mydb odoo.addons.jasper_reports.jasper_report: Temporary data file: '/tmp/tmppaz1h1r_'
2018-03-26 13:29:09,108 1 WARNING mydb odoo.addons.jasper_reports.JasperReports.browse_data_generator: Field '' (path: partner_id/) does not                    exist in model 'res.partner'.
2018-03-26 13:29:09,108 1 WARNING mydb odoo.addons.jasper_reports.JasperReports.browse_data_generator: Field '' (path: company_id/) does not                    exist in model 'res.company'.
JayVora-SerpentCS commented 6 years ago

@saif-serpentcs

dcorio commented 6 years ago

That happened in a docker container. By installing Odoo from source using the canonical way i get a different but related error:

Error:
Uncaught SyntaxError: Unexpected token T in JSON at position 0

http://localhost:8069/web?debug=assets#id=8&view_type=form&model=sale.order&action=243:1
Traceback:
SyntaxError: Unexpected token T in JSON at position 0
    at JSON.parse (<anonymous>)
    at HTMLIFrameElement.<anonymous> (http://localhost:8069/web/static/src/js/core/ajax.js:264:40)
    at HTMLIFrameElement.dispatch (http://localhost:8069/web/static/lib/jquery/jquery.js:4641:58)
    at HTMLIFrameElement.elemData.handle (http://localhost:8069/web/static/lib/jquery/jquery.js:4309:63)

And in the server log i see:

  File "/Users/enlightx/Development/Odoo/11.0/odoo/addons/jasper/jasper_reports/JasperReports/jasper_server.py", line 75, in start
    raise UserError(_('libraries Not Found !\n'
odoo.exceptions.UserError: ('libraries Not Found !\nThere is No libraries found in Java', '')
dcorio commented 6 years ago

this issue seems related: #39

dcorio commented 6 years ago

Just noticed the java_path field on the company record. I think you should use a property and not a field on res.company, but you should check for the $JAVA_HOME env variable first.