Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pos_product_template DOM error #73

Closed
shawnvarghese opened this issue Jan 4, 2016 · 8 comments
Closed

pos_product_template DOM error #73

shawnvarghese opened this issue Jan 4, 2016 · 8 comments

Comments

@shawnvarghese
Copy link

The following message appears when loading POS.
"Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('file://') does not match the recipient window's origin ('http://127.0.0.1:8069')"

Possibly due to DOM manipulation as mentioned in the source code (for click_set_attribute_handler() and click_reset_attribute_handler() functions)

POS crashes after sometime due to this bug.

@legalsylvain
Copy link
Contributor

Could you mention wich version of Odoo you are using. (odoo / OCA). revision... thanks.

@shawnvarghese
Copy link
Author

Yes, sorry... Build Odoo 8.0-20151016 . I'm using the OCA pos_product_template module .

image

@shawnvarghese
Copy link
Author

Could someone please help rectify this issue. The whole session crashes and the user has to log back into Odoo because of the bug.

@shawnvarghese
Copy link
Author

Please let me know if there are any details I need to provide for this bug. Would be very grateful to anyone who can help fix it, as the code is in our production server and is causing serious problems.

@shawnvarghese
Copy link
Author

I think the issue arises due to some part in the following code snippet. But I am not sure what it does or how it should be rectified. Any help would be highly apprecitated!


`init: function(parent, options) {
            var self = this;
            this.attribute_list = [];
            this.product_template = null;
            this.click_set_attribute_handler = function(event){
                /*TODO: Refactor this function with elegant DOM manipulation */
                // remove selected item
                parent = this.parentElement.parentElement.parentElement;
                parent.children[0].classList.remove('selected');
                for (var i = 0 ; i < parent.children[1].children[0].children.length; i ++){
                    elem = parent.children[1].children[0].children[i];
                    elem.children[0].classList.remove('selected');
                }
                // add selected item
                this.children[0].classList.add('selected');
                self.__parentedParent.variant_list_widget.set_filter(this.dataset['attributeId'], this.dataset['attributeValueId']);
            };
            this.click_reset_attribute_handler = function(event){
                /*TODO: Refactor this function with elegant DOM manipulation */
                // remove selected item
                parent = this.parentElement;
                parent.children[0].classList.remove('selected');
                for (var i = 0 ; i < parent.children[1].children[0].children.length; i ++){
                    elem = parent.children[1].children[0].children[i];
                    elem.children[0].classList.remove('selected');
                }
                // add selected item
                this.classList.add('selected');
                self.__parentedParent.variant_list_widget.reset_filter(this.dataset['attributeId']);
            };
            this._super(parent, options);
        },`

@legalsylvain legalsylvain added this to the 8.0 milestone Jan 30, 2016
@shawnvarghese
Copy link
Author

Could anyone please help fix this? The POS keeps crashing because of this.

@legalsylvain
Copy link
Contributor

Hi @shawnvarghese. Sorry I can't help you. I'm not expert in DOM manipulation. Maybe @hparfr will have good proposal to do.

regards.

@hparfr
Copy link
Contributor

hparfr commented Jan 8, 2018

Is this issue still occurring ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants