Help

2

CSS error - Uncaught SecurityError: Failed to read the 'rules' property from 'CSSStyleSheet': Cannot access rules https://oursite.com/web_editor/static/src/js/transcoder.js:16 - when trying to edit a Quote or add a follower to one.

Avatar
Patrick Miller

Just started getting this whenever we try to edit a quote, or add a follower to one. Ideas?


Uncaught SecurityError: Failed to read the 'rules' property from 'CSSStyleSheet': Cannot access rules https://oursite.com/web_editor/static/src/js/transcoder.js:16 Traceback:

Error: Failed to read the 'rules' property from 'CSSStyleSheet': Cannot access rules

    at getMatchedCSSRules (https://oursite.com/web_editor/static/src/js/transcoder.js:16:27)

    at Object.style_to_class (https://oursite.com/web_editor/static/src/js/transcoder.js:193:5)

    at Class.render_value (https://oursite.com/web_editor/static/src/js/backend.js:150:24)

    at Class.reinitialize (https://oursite.com/web/static/src/js/views/form_common.js:158:28)

    at Class.trigger (https://oursite.com/web/static/src/js/framework/mixins.js:222:31)

    at Class.trigger (https://oursite.com/web/static/src/js/framework/mixins.js:272:42)

    at https://oursite.com/web/static/src/js/framework/mixins.js:337:22

    at Function._.each._.forEach (https://oursite.com/web/static/lib/underscore/underscore.js:150:9)

    at Class.set (https://oursite.com/web/static/src/js/framework/mixins.js:318:11)

    at Class.test_effective_readonly (https://oursite.com/web/static/src/js/views/form_common.js:422:18

2 Comments
Avatar
Discard

I realized that in a new database the problem doesn't appear until the "mail" module is installed. I don't know what is the cause of this....

Avatar
Jithin
-

Please refer this link.

https://github.com/odoo/odoo/issues/22517

Okay, the solution is to change the code of transcoder.js located in web_editor/static/src/js:

The property "rules" is not well checked.

This line is wrong (around line number 16):

if (sheets[i].rules) {

It has to be changed to this:

if (sheets[i].hasOwnProperty('rules')) {

5 Answers
1
Avatar
Rupesh Patel
Best Answer

Hi Patrick,

I have encountered the same problem.

Possible Fix:

You might need to update the time zone of the user to match with the machine you are using.

Go to > settings > users > Locate the user record > preferences > and change the Timezone.

(if  the timezone on preference is different than your local machine time zone, you will see a warning icon on the timezone record.)

Regards,

Rupesh Patel 

3 Comments
Avatar
Discard

Okay, I realized that in a new database the problem doesn't appear until the "mail" module is installed. I set the timezone on preference now. Then, I install the "mail" module. But the problem persist.

Avatar
Rupesh Patel
-

MouTio , Are you using chrome ? have you tried other browser ? check the timezone on your browser too. by these page : http://www.informit.com/articles/article.aspx?p=1766155&seqNum=4

Rupesh Patel, yes, I am using Google Chrome on Windows 10. In Mozilla Firefox the error doesn't appear.

0
Avatar
Piotr Cierkosz
Best Answer

It happens in V9c 
Just started today in my case. The interesting thing is it does not happen when in developer mode.

Avatar
Discard
0
Avatar
Hardikgiri Goswami
Best Answer

Hi Patrick,

I face the same issue and after google it, I found that some one solved it. I haven't tried it yet.

You can see the whole discussion regarding this error is following link.

https://github.com/odoo/odoo/issues/22517

I don't know if it is helpful or not. But I will try this and post my updates here.

Regards. 

Avatar
Discard
0
Avatar
Jithin
Best Answer

I think this issue occur in this module

addons/mail/static/src/js/announcement.js

Line no.15

Avatar
Discard
0
Avatar
Aslam Up
Best Answer

Go to \addons/web_editor/static/src/js/transcoder.js

Change line no 16:

>>> if sheets[i].rules; to if (sheets[i].hasOwnProperty('rules'))

Thanks 

Avatar
Discard