跳至內容
選單
此問題已被標幟
2 回覆
7587 瀏覽次數

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.

頭像
捨棄
最佳答案

Hi,

Just remove the param{ 'nodestroy': True,}

頭像
捨棄
最佳答案

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)

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
5月 16
8555
3
2月 24
13049
1
12月 24
4465
1
11月 16
9859
1
2月 16
4086