India

ZestyBeanz Technologies Pvt Ltd 4th Floor, Nila, Technopark Thiruvananthapuram,
India – 695581
Phone: +91 471 4063254
Fax : +91 471 2700171

   .

ZestyBeanz Technologies Pvt Ltd
61/3236, Manikkath Cross Road
Ravipuram, Kochi, India - 682016
Phone: +91 484 4063254

  UAE

Zesty Labs
Office # 2003, Millennium Plaza Building
Sheikh Zayed Rd, Dubai, UAE
Phone: +971 4333 2222​
Mobile: +971-52-7553466

  Germany​

ZestyBeanz Technologies GmbH
Reuterstraße 1
90408 Nürnberg
Fon: +49 911 4801 444
Fax: +49 911 4801 445

Advanced Printscreen for Odoo 7 and Odoo 8(Analytic Report Printing)

Contact Form


Prajul P T's picture

Advanced Printscreen for Odoo 7 and Odoo 8(Analytic Report Printing)

Printscreen has been and is an attractive feature of OpenERP. But unfortunately this feature was available for OpenERP 6.1 GTK Client. OpenERP 7 provide an functionality to print the current view in PDF.

You may have already noticed that i have already published a blog named "Printscreen in OpenERP 7 which was a migrated module from web_export_view with few my own functionality added to it. But now we have developed a new module called web_printscreen_zb with some new features that might be helpful to users of OpenERP 7. 

The main features of this module are:

  • Ability to export view in both PDF as well as in Excel.
  • Ability to export analytic views in to PDF and Excel including group totals.
  • Hierarchical view of the groups.

The module can be installed as a normal OpenERP module. The only python dependency that is need for the module is python-xlwt which is needed to export to xls file. This can be installed using the comment "sudo apt-get install python-xlwt" for Ubuntu. After installing the module, you can see two anchor buttons called "Export to PDF" and "Export to Excel" on the right side of the OpenERP web client as shown in the screenshot below:

These buttons will only appear if the active view is a tree view. This button wont be visible in any of the other view types. When the button "Export to PDF" is clicked, the report will be exported to PDF or if "Export to Excel", the report will be printed in "Excel". The heading and the totals will be printed in Bold. A sample screenshot of the excel and PDF report is shown below:

The module also allows to print analytic reports in to CSV of excel. The screenshot below shows an analytic view:

You can also see the "Export to Excel" and "Export to PDF" in the top right side of the view. If you click the button "Export to Excel", it will be exported to excel else if "Export to PDF", it will be exported to "PDF". A sample report is shown below:

A video showing the functionality of the module is shown below:

The module is attached with the blog. Module is also shared at https://github.com/zbeanz/openerp-7-web-addons. Module can also be downloaded from launchpad bzr branch lp:~r-launchpadzbeanz/zbeanz/addons.

Module is also available in Odoo 8. Module is attached with the blog.

AttachmentSize
web_printscreen_zb_24_mar_v7.zip18.16 KB
web_printscreen_zb_24_mar_v8.zip18.69 KB

Kevin McMenamin's picture

thanks for this module. The

thanks for this module. The issue I have is the export only works for up to 200 rows of data - after that it just times out. Is this expected behaviour?

Prajul P T's picture

Hi,      This is not the

Hi,

     This is not the expected behavior. We have tested the module with more that 3000 records. Can you please check if there is any error in server log.

Kevin McMenamin's picture

found the error: xlwt set

found the error: xlwt set style making error: More than 4094 XFs (styles)

the solution was: wb = xlwt.Workbook(style_compression=2)

now successfully exporting 5,000 rows of data.

Antoine Morit's picture

This module is awesome ! Just

This module is awesome !
Just have to declare a new tree-view and you have a light report and Excel export !
Many thanks for sharing it..

Hans's picture

Hi Prajul, Great addons, but

Hi Prajul,
Great addons, but I found a bug when I want to print with pdf,
I cannot print it. It doesnt download anything.
There's an error message in the log:

2014-02-17 02:16:52,675 20199 ERROR ONL openerp.addons.web.http.HttpRequest.dis$
Traceback (most recent call last):
File "/opt/openerp70/falinwa_branch/web/http.py", line 285, in dispatch
r = method(self, **self.params)
File "/opt/openerp70/falinwa_branch/web_printscreen_zb/controllers.py", line $
cookies={'fileToken': int(token)})
File "/opt/openerp70/falinwa_branch/web/http.py", line 332, in make_response
response.set_cookie(k, v)
File "/usr/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 992, in se$
self.charset))
File "/usr/lib/python2.7/dist-packages/werkzeug/http.py", line 905, in dump_c$
value = to_bytes(value, charset)
File "/usr/lib/python2.7/dist-packages/werkzeug/_compat.py", line 106, in to_$
raise TypeError('Expected bytes')
TypeError: Expected bytes

This problem only occur on my cloud server, when I try in my local its worked. I used your lasted version module (v4).

Do you know what is the problem?

Thank you.

Prajul P T's picture

Hi,     Can you please check

Hi,

    Can you please check if python-xlwt package is installed in the server. If this don't fix the issue can you please specify from where you are getting the error. ie; while printing which record you are getting the error.

Hans's picture

Hi Prajul, Thank's for your

Hi Prajul,

Thank's for your response,
The error occured everywhere(such as purchase order,supplier,sale order, etc) when I try to print in pdf, in excel its worked fine.
Even when I try on demo database the error still occured.

The error is always the same:
2014-02-17 02:16:52,675 20199 ERROR ONL openerp.addons.web.http.HttpRequest.dis$
Traceback (most recent call last):
File "/opt/openerp70/falinwa_branch/web/http.py", line 285, in dispatch
r = method(self, **self.params)
File "/opt/openerp70/falinwa_branch/web_printscreen_zb/controllers.py", line $
cookies={'fileToken': int(token)})
File "/opt/openerp70/falinwa_branch/web/http.py", line 332, in make_response
response.set_cookie(k, v)
File "/usr/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 992, in se$
self.charset))
File "/usr/lib/python2.7/dist-packages/werkzeug/http.py", line 905, in dump_c$
value = to_bytes(value, charset)
File "/usr/lib/python2.7/dist-packages/werkzeug/_compat.py", line 106, in to_$
raise TypeError('Expected bytes')
TypeError: Expected bytes

Prajul P T's picture

Hi,      I can't reproduce

Hi,

     I can't reproduce the error on my side. I have tested it in one our servers and its working fine. Can you please try replacing werkzeug in path /usr/lib/python2.7/dist-packages/werkzeug. You can download it from https://dl.dropboxusercontent.com/u/88263455/werkzeug.zip.

Please let me know the result.

Hans's picture

ahh, I see.. its because my

ahh, I see..
its because my cloud running on ubuntu 13
and its run on latest werkzeug (v9)
I must do this first : sudo pip install werkzeug==0.8.3

and its worked fine now.

Thank you for your help.

ps: Very great addons by the way.

Anonymous's picture

Hi, I Notice one of your

Hi,

I Notice one of your order analysis page shows cost price & total cost column, which is not the default case. I just followed
http://help.openerp.com/question/17156/add-more-fields-to-pos-order-anal...
http://www.zbeanztech.com/blog/sales-analysis-report

unfortunately I keep getting issue, where cost_price is not exist in pos order model - what am i missing? can anyone help?

ProgrammingError: column report_pos_order.cost_price does not exist
LINE 1: ...ort_pos_order"."product_qty") AS product_qty, sum("report_po...

using Openerp7;