Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

How to generate a report from a wizard?

By
Yakito
on 6/24/13, 6:59 PM 7,768 views

Hello,

I am looking for documentation/example modules or anything were I can learn how to create a report from a wizard. The ending report should use the variables passed by the wizard to generate the PDF.

For example a report that would show only the rows in my module were the date field is June.

I already have the wizard working but I don't understand how to link the print button to a report or even how to send the variables to be able to generate the report with them.

Any module or documentation that anyone can point me would be much appreciated as I couldn't find much.

Thanks in advance

hi, i have the same need. i created report, added it to open erp,my report is of type pentaho.when clicking print it shows entire data, filtering not works.my form is same as Reports/point of sale/sale Details, the difference is that i am using pentaho reporting.How can i filter data please help

Anuradha
on 8/28/13, 4:23 AM

Can you help me in saving the Partner Ledger Report (webkit) to attachments, it has a many2many field partner_ids, i want to save the pdf as partner_name.pdf, please help in writing the expression for that.

evon_dun
on 10/8/13, 8:50 AM
4

Keyur

--Keyur--
1165
| 4 4 8
Ahmedabad, India
--Keyur--

Odoo Expert

Keyur
On 6/25/13, 3:48 AM

Hi Yokito,

I am giving you the simplest way to generate report from wizard. Just follow the steps:

(1) Make a simple report in your report.xml file.

(2) Make a simple wizard with a button

Button 1-For generate report

(3) On a button call a method like this,

def print_report(self, cr, uid, ids, context=None):
    datas = {}
    if context is None:
        context = {}
    data = self.read(cr, uid, ids)[0]
    datas = {
                 'ids': [],
                 'model': 'object.object',
                 'form': data
    }
    return {'type': 'ir.actions.report.xml', 'report_name': 'your_report_name', 'datas': datas}

(3) Start your server, update your module, open a wizard you created click on the button and then the report will print.

Hope these guidelines are helpful to generate report from wizard.

Thanks.

Thanks, so datas is passing the variables from my form, right? And I can access them through a function in my report_name.py?

Yakito
on 6/25/13, 11:37 AM

Yes sure. By repeatIn in rml you can have a loop if you have multiple records or you can call a function from rml file. Take a look at this link http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/point_of_sale/report/account_statement.rml#L155

Keyur
on 6/25/13, 11:45 AM

hi, i have the same need. i created report, added it to open erp,my report is of type pentaho.when clicking print it shows entire data, filtering not works.my form is same as Reports/point of sale/sale Details, the difference is that i am using pentaho reporting.How can i filter data please help

Anuradha
on 8/28/13, 4:14 AM

Sorry but I have not any idea about Pentaho reports. But I think it would be same as for the other reports.

Keyur
on 9/17/13, 9:24 AM

I am calling an already created report of mine which shows the list of the invoices. I added two fields date_from n date_to to the wizard that prints this report but i am not able to print these dates on the report. Please help. here is the link to my detailed question http://help.openerp.com/question/34705/print-value-of-a-field-in-wizard-to-report/

evon_dun
on 10/28/13, 3:02 AM

Hi! I did that but then my wizard doesn't close, do you have any suggestion?

Versão Integral, Anabela Damas
on 4/16/15, 6:09 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 6/24/13, 6:59 PM
Seen: 7768 times
Last updated: 9/10/16, 9:02 AM