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.
Attachment | Size |
---|---|
web_printscreen_zb_24_mar_v7.zip | 18.16 KB |
web_printscreen_zb_24_mar_v8.zip | 18.69 KB |
Yes. I am
Yes. I am using web_printscreen_zb_20_may_2014.zip. Which OpenERP server are you using(Date).
Hello your module sounds
Hello your module sounds Great, but when i want to install it i got this error
from web.controllers.main import ExcelExport
ImportError: No module named controllers.main
Hi Prajul, I tried it to
Hi Prajul,
I tried it to install
1. I unzipped the module and pasted in addons directory.
2. Then I refresh the eclipse.
3. I ran the command for python but it says it is already in the new version.
4. update module list.
But still it is not showling.
Not able to install. please help
Thanks in Advance
:-)
hi, I'm having 1 problem I'm
hi, I'm having 1 problem
I'm using python OpenERP source code, when export excel file to save it but nothing appears
if anyone has seen this case to help me with
thank you
ah! i'm using openerp 6
Hi, Is there any server
Hi,
Is there any server error log?
Hi Amol, Please
Hi Amol,
Please restart your OpenERP server and then update the module list.
Hi Prajul, Your module looks
Hi Prajul,
Your module looks like incredible, but when I install it, the new buttons don't appear and I have an error message:
OpenERP Server Error
Client Traceback (most recent call last):
File "/opt/openerp/openerp/addons/web/http.py", line 204, in dispatch
response["result"] = method(self, **self.params)
File "/opt/openerp/openerp/addons/web/controllers/main.py", line 1125, in call_button
action = self._call_kw(req, model, method, args, {})
File "/opt/openerp/openerp/addons/web/controllers/main.py", line 1113, in _call_kw
return getattr(req.session.model(model), method)(*args, **kwargs)
File "/opt/openerp/openerp/addons/web/session.py", line 42, in proxy
result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
File "/opt/openerp/openerp/addons/web/session.py", line 30, in proxy_method
result = self.session.send(self.service_name, method, *args)
File "/opt/openerp/openerp/addons/web/session.py", line 103, in send
raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)
Server Traceback (most recent call last):
File "/opt/openerp/openerp/addons/web/session.py", line 89, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/opt/openerp/openerp/netsvc.py", line 292, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/openerp/openerp/service/web_services.py", line 626, in dispatch
res = fn(db, uid, *params)
File "/opt/openerp/openerp/osv/osv.py", line 188, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/opt/openerp/openerp/osv/osv.py", line 131, in wrapper
return f(self, dbname, *args, **kwargs)
File "/opt/openerp/openerp/osv/osv.py", line 197, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/opt/openerp/openerp/osv/osv.py", line 185, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/opt/openerp/openerp/addons/base/module/module.py", line 424, in button_immediate_install
return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)
File "/opt/openerp/openerp/addons/base/module/module.py", line 475, in _button_immediate_function
_, pool = pooler.restart_pool(cr.dbname, update_module=True)
File "/opt/openerp/openerp/pooler.py", line 39, in restart_pool
registry = RegistryManager.new(db_name, force_demo, status, update_module)
File "/opt/openerp/openerp/modules/registry.py", line 218, in new
openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File "/opt/openerp/openerp/modules/loading.py", line 345, in load_modules
processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules, update_module)
File "/opt/openerp/openerp/modules/loading.py", line 256, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/opt/openerp/openerp/modules/loading.py", line 165, in load_module_graph
init_module_models(cr, package.name, models)
File "/opt/openerp/openerp/modules/module.py", line 374, in init_module_models
result = obj._auto_init(cr, {'module': module_name})
File "/opt/openerp/openerp/osv/orm.py", line 3162, in _auto_init
default = self._defaults[k](self, cr, SUPERUSER_ID, context)
File "/opt/openerp/openerp/addons/delivery/stock.py", line 140, in
'weight_uom_id': lambda self,cr,uid,c: self._get_default_uom(cr,uid,c)
File "/opt/openerp/openerp/addons/delivery/stock.py", line 138, in _get_default_uom
return self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id),('factor','=',1)])[0]
IndexError: list index out of range
Can you help me ?
Hi, This error is not
Hi,
This error is not from my module. I think you have deleted some UOM from ERP. There are some UOM which should not be deleted. Please update the product module. But i think you have to do some modification in the product module. The UOM are loaded from the file product_data.xml in product module and this file has <data noupdate="1"> set. Change it to <data noupdate="0"> and update the product module.
Try updating the product module without the above said modification. If the error still exist, please do it as explained above.
Thank you, I've found the
Thank you,
I've found the error and the installation is now completed !
This module is awesome !
Hi Prajul, As Thanks for this
Hi Prajul,
As Thanks for this module development, I have improve this module to become cooler. So here is the log that I improved:
1. Now support for all tree view(I am not talking about listview but treeview, such as tree in Product Category or analytic accounting or Journal Items).
2. Support for windows in "new" mode (popup).
3. Improve link (pdf or excel) to be button like other openERP, so it more elegant to see and more neat.
Need to be improve:
1. Support for form view too, now its not support yet. (This will be hard task)
I want to propose the merge with your branch but I dont know how,
here is the link of my branch: lp:~hans-yonathan/printscreen/trunk
Maybe this will be start for our partnership.
fyi: I have developed many cool module too and I will be happy if we can share our module to each other.
Thank you.