This question has been flagged

Hi. 

I've installed the web_printscreen module and the button Printscreen appears near More button.

When I'm in list view everything works fine. But when I'm in form view if I click in PDF or EXCEL I get the folowing error: 

"Cannot read property 'length' of undifined"

I wanted to know if you know how to fix it or how to remove the button "Printscreen" from form view? 

I've tryed like this in .../web_printscreen/static/xml/printscreen.xml :

<t t-name="AddPrintScreenMain"  class="oe_list_content">

but nothing happened...

Thanks

Avatar
Discard

Hello, Need more information from where you have downloaded this module and on which version are you running because this module is not standard in Odoo !

Author

I don't know, was a colleague that find this, in the file __openerp__.py : 'author': 'Zesty Beanz Technologies', 'website': 'http://www.zbeanztech.com/', 'version': '2.1', It seems to be this one : http://www.zbeanztech.com/blog/printscreen-openerp-7?page=2

Best Answer

Hello,

The message is because the code is looking for visible column. But like you said, when you are in a form view, you have no columns.

So this module is done to work only with list view.

If you don't want to add the button in other view, you can update the JS file and add a condition in the redraw function : 

if (self.getParent().ViewManager.active_view === "list") {
                self.$el.find('.oe_sidebar').append(...
                self.$el.find('.oe_sidebar_printscreen_pdf')....
                self.$el.find('.oe_sidebar_printscreen_xls')....
}

It's maybe to check and to improve, but it's a first step :)

 

Good luck

Avatar
Discard
Author

Thanks ;)