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.

0

No close wizard report

By
josemi
on 9/2/16, 3:34 AM 225 views

I have a wizard with a button that has this code:

@api.multi
def btn_print_report(self):
    return {
        'type': 'ir.actions.report.xml',
        'report_name': 'report',
        'nodestroy': True,
    }

But when you print the report closes the wizard, ie disappears and I have to open it again. I would like the wizard will not close.

3
Cybrosys Technologies
On 10/31/16, 1:05 AM

Try this method used in 'account_financial_report.py'

def _print_report(self, cr, uid, ids, data, context=None):

        data['form'].update(self.read(cr, uid, ids, ['date_from_cmp', 'debit_credit', 'date_to_cmp', 'fiscalyear_id_cmp',         'period_from_cmp', 'period_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter','target_move'],         context=context)[0])

        return self.pool['report'].get_action(cr, uid, [], 'account.report_financial', data=data, context=context)

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

1 follower(s)

Stats

Asked: 9/2/16, 3:34 AM
Seen: 225 times
Last updated: 11/18/16, 11:41 PM