Printscreen in OpenERP 7

        Print screen was a feature of OpenERP which enables the user to take the printout of the tree view of the selected records. This feature was available in OpenERP 6.1 GTK client was not available in OpenERP 6.1 web client and OpenERP 7. In OpenERP 7, there is an option to take printout of the tree view. But in OpenERP 7 we cannot select the particular records which we want to print in the report. 

           We have developed a new module which enables users to take the printout of the selected records in the tree view. The module name is web_print screen. After installing the module, a new dropdown will be available in the header of each tree view. No configuration is required, jut installing the module is enough. A screenshot is shown below:

Print screen Menu

In the screenshot you could see on the top a new menu called “Print screen” has be added. It is a dropdown menu in which the user can select weather to print in PDF of Excel. A screenshot is shown below:

Print screen Dropdown

In the menu, user can either select to print the report in PDF or in Excel. When the user selects all the rows and select to print PDF, all the records will be printed. A screen shot is shown below:

Tree view with all records selected

Report Generated when all records selected

When selected particular records, only the selected records will be printed. A screenshot is shown below:

Tree view with tree records selected

Report generated when tree records selected

A screenshot of the excel report printed when all the records are selected is shown below:

Excel report generated when all records selected

The column name and number will vary based on the columns in the view selected.

Thanks to  http://www.agilebg.com for excel export code.(module web_export_view)

Comments

Prajul P T: Yes... I think it can be made possible... ".

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Ray Carnes says:

    I tried this today. PDF seems to work OK. Excel doesn't: File "/opt/openerp/custom/web_export_view/controllers.py", line 22, in index AttributeError: 'OpenERPSession' object has no attribute 'eval_context'

    1. Prajul P T says:

      Hi,

          From the traceback you have given, i think it is not coming from this module but from web_export_view. Please uninstall this module and try again.

      1. Ray Carnes says:

        Yes – this was the problem – thanks again for a great module.

    2. FCH says:

      Hello,
      Nice work, I tested it and it works fine with me.
      One suggestion though: since this feature is not supposed to work with form/graph/… view mode, couldn’t it be hidden when switching to those?
      Thank you,

      1. Prajul P T says:

        Hi,

            Thank You for your valuable suggestion. I am working on it now. Will update the module when finished and inform you.

  2. Cristian Salamea says:

    Hi great work ! this feature was so used in gtk.
    Do you test it in 6.1 ? i am downloading now and test it too.
    Regards,

  3. Ray Carnes says:

    Numeric fields are exported as TEXT. When exporting something like Customer Invoices, the BALANCE, SUBTOTAL and TOTAL fields (containing numeric data) are showing up in Excel as TEXT.

    1. Ray Carnes says:

      The numeric export issue has been fixed with the 6.1 version of this module, see https://bugs.launchpad.net/web-addons/+bug/1046342 – I will look into how applicable this fix is for the 7.0 version – but if anyone beats me to it please post back.

      1. Prajul P T says:

        Hi,

             Sorry for not repling for long. I was a little bit busy. And thanks any way for your valuable comments. I have fixed the issue with the float fields being displayed as text. I have attached the new module in my blog. I will be uploading it to launchpad and the link will be shared here. All your valuable comments are welcome…..

    2. Prajul P T says:

       

      Hi,

           Sorry for not repling for long. I was a little bit busy. And thanks any way for your valuable comments. I have fixed the issue with the float fields being displayed as text. I have attached the new module in my blog. I will be uploading it to launchpad and the link will be shared here. All your valuable comments are welcome…..

  4. eLBati says:

    Great module! Do you have any public code repository for this?

  5. OpenCode says:

    If possible can you post code on any VCS hosting as Launchpad?

  6. Cristian Salamea says:

    Hi i test it the module words great ! just some lost feature group by in report.
    For all 6.1 users i backported the module to 6.1 https://github.com/ovnicraft/web-addons, i keep authors and thanks for this work !.
    Regards,

  7. Leonardo Pistone says:

    Hi,
    Thanks for your post. This module is actually an improvement over web_export_view, a module that is already in the new openerp community branches.
    That module was for OpenERP 6.1 only, so it is great you ported it to OpenERP 7.
    However, compare the main JS file in web_export_view
    http://bazaar.launchpad.net/~webaddons-core-editors/web-addons/6.1/view/head:/web_export_view/static/js/web_advanced_export.js
    to the corresponding web_printscreen/static/js/web_printscreen.js
    It is basically the same code with copyright notices removed (same code, variables, indentation etc.)
    I would suggest posting a merge proposal of your work to the 7.0 branch of the community web-addons:
    https://code.launchpad.net/~webaddons-core-editors/web-addons/7.0
    Of course you can acknowledge your work in the AUTHORS file.
    Thanks!

  8. Rjay says:

    Hello
    Is it possible to add headers, where I can put my text address and company logo?

  9. Hector Ivan Valencia Muñoz says:

    The module does not work correctly when the language setting has the point (.) as thousands separator and comma (,) as decimal separator. (Spanish language).

  10. David Béal says:

    How do you manage updates without VCS system ? You may share maintenance with other openerp partner contributions with a vcs systems like bazaar.
    How can i be sure your module is sustainable (in time) without a professional way to manage it ?
    Thanks for your response.

    1. Anonymous says:

      The module on which this one was ‘based’ or ‘inspired’ (depending on your point of view) is at https://code.launchpad.net/~domsense/web-addons/7.0-web_export_view

    2. Anonymous says:

      Hello. PDF is working fine. But with Excell, files are not created. No error message, just the window to ask for the file name and then nothing. No error message into OpenERP logs.

  11. Anonymous says:

    hi this module works perfect but the thing is it is printing in excel format if we do in tree view only not in form view, .. how to do that

      1. Anonymous says:

        yes I installed it.. but it is availabe on tree view only right. What abt form view to get a report in excel format?

        1. Prajul P T says:

          Hi,

             Currently the printscreen functionality is available in tree view and analysis tree view only.

          1. Anonymous says:

            ok Is it possible to achieve that through changing code?

          2. Prajul P T says:

            Yes… I think it can be made possible…

        2. eLBati says:

          web_export_view is already able to export lists within a form (in XLS format of course)

          1. Prajul P T says:

            Hi,

                 Yes by using web_export_view we can export the tree view inside the for view like one2many fields. But we cant export other fields and if there is more than one such field in the form view, we will be able to export only one field. For example, in invoice we have the invoice lines and payments of the invoice. So if i export the invoice to excel, we will be able to export only invoice lines. If it is possible to export all the fields, please guide me…. I have downloaded the module from https://code.launchpad.net/~domsense/web-addons/7.0-web_export_view

  12. Anonymous says:

    I have to print the form view so can we print the form view in the same manner.

    1. Prajul P T says:

      Hi,

          It can be done but unfortunately, that functionality is not available now…

    2. Gaylene Kanae says:

      I don't even understand how I ended up here, but I thought this publish used to be great. I don't recognise who you are however certainly you are going to a famous blogger in the event you aren't already. Cheers!

      1. Prajul P T says:

        Thanks…….

    3. Anonymous says:

      This button is not showing in Bill of Materials Structure. Any reason why?

  13. Morad says:

    excellent work

  14. Shyam says:

    Hello,
    This module is so so useful. Thanks for such kind of activity.
    But I have one little issue, If I run module in ubuntu its working fine for me but when I work with Centos that time its not generate excel file only pdf file is generated.
    Please do nedful help.
    Thanks,
    Shyam.

    1. Prajul P T says:

      Hi Shyam,

            This module requires an additional python package 'python-xlwt'. Please confirm that this package is installed in your CentOS. Please try this module also module http://zbeanztech.com/blog/advanced-printscreen-openerp-7

      1. Shyam says:

        Hello,
        Ya I find the solution. There was missing xlwt library.
        You can put require package in description.
        Thanks.
        Shyam

      2. Shyam says:

        Hello,
        Yes I got solution. I installed xlwt package. Now its working fine.
        You can put pre require package in __openerp__.py files description.
        So non-python or Non-OpenERP user can use understand easily.
        Thanks.
        Shyam.

  15. Samba says:

    Thank you Zesty Beanz. I am using this module in odoo-7 allot. But rescently we are learning odoo-8. Can you provide this module for odoo-8. I have installed this module in odoo-8. But the option excel/pdf print not showing to me.

    1. eLBati says:

      Hello,
      you can find version 8 of web_export_view at
      https://www.odoo.com/apps/modules/8.0/web_export_view/

      1. Prajul P T says:

        Hi eLBati,

              Thanks for your comment. Please try one of our module which is also available in Odoo 8. You can download it from http://www.zbeanztech.com/blog/advanced-printscreen-openerp-7

        Thanks..

    2. Prajul P T says:

      Hi,

          Please try our module http://www.zbeanztech.com/blog/advanced-printscreen-openerp-7 its is avalable in Odoo 8 also. The module is attached with the blog..

      1. Noel says:

        Hi Prajul,
        I already installed this module on a latest version of openerp 7 but does not work where grouping. Could you check this please
        Thanks in advance.
        Noel

    3. Anonymous says:

      I have similar issue, Odoo v8. The links PDF and Excel are visible for page with the lists, but if the page is view type = tree then the links are not visible. Example of this is “Bill of Materials Structure” page.

  16. Anonymous says:

    I have installed your module in Odoo v8. It shows PDF and Excel links when view_type is list. But, when I navigate to page with view_type=tree, the links are not showing. Example is “Bill of Materials Structure” page. Correct me if I am wrong, but I think that your module works only for lists but not for trees.

  17. Juan says:

    Excelente Aporte, se agradece el trabajo.
    Tengo una consulta, y es que por defecto me exporta el pdf en A4 y me seria muy utiil su puedo exportar a Letter u otro tamaño de papel. he mirado el código del modulo pero no he logrado cambiar si me pueden dar una ayuda le estaría muy agradecido.
    Saludos…

  18. Shahid says:

    how to place a company logo in the begining of the excel report as in the pdf report with this module.

  19. renuka says:

    You did really good work. I really appreciate your new and different post. Please guys keep it up and share with us some unique post in the future…

© 2020 Zesty Beanz Pvt Ltd All Rights Reserved.