Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

"Uncaught SecurityError" when printing ALL Reports in Chrome Only, Works in Firefox

By
Travis Waelbroeck
on 10/20/16, 3:58 AM 315 views

I am getting an error in Odoo 9 Community whenever I try to print any report (PDF) from the backend. Error confirmed to occur for sale, invoice, purchase, and delivery reports. This only happens in Chrome - it works without errors in Firefox.


Despite the error, the reports DO still print normally.

I do have web.base.url set in the System Parameters and I don't have any other odd behaviors.


Error thrown by Odoo is:

Odoo Client Error:

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

http://my.domain.com/web/static/src/js/framework/ajax.js:231

Traceback:
Error: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://my.domain.com" from accessing a cross-origin frame. at Error (native) at HTMLIFrameElement.<anonymous> (http://my.domain.com/web/static/src/js/framework/ajax.js:231:36) at HTMLIFrameElement.dispatch (http://my.domain.com/web/static/lib/jquery/jquery.js:4641:58)
at HTMLIFrameElement.elemData.handle (http://my.domain.com/web/static/lib/jquery/jquery.js:4309:63)


Error thrown by Chrome Console:

Refused to display 'http://my.domain.com/report/download' in a frame because it set 'X-Frame-Options' to 'DENY'.
Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Sandbox access violation: Blocked a frame at "http://my.domain.com" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag.


Why is this error being thrown and how can it be fixed?

0

Nilmar Shereef

--Nilmar Shereef--
811
| 4 3 7
Calicut, India
--Nilmar Shereef--

Python Developer. Android Developer. .Net Developer

Nilmar Shereef
On 11/1/16, 2:04 AM

This issue fired when you try to call ajax to another domain, please check this article for more info about Same origin policy. Please check the link below.
https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy#Changing_origin

I looked into that issue and I dug into the Chrome Developer Tools to see the domain trying to be referenced. Only domains I found were the Odoo domain (good) and an empty domain, which I assume is the source of the problem. However, I have no idea why it would only cause errors in Chrome and no errors in Firefox.

Htm-Mbs, Travis Waelbroeck
on 11/1/16, 3:17 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/20/16, 3:58 AM
Seen: 315 times
Last updated: 11/1/16, 2:04 AM