Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
7321 Vizualizări

Hi, 

I have  a wizard with a button  where return this: 

return self.env['report'].get_action(record_to_print, 'account.report_invoice')

But I wanted to close the wizard after print the report. 

When I don't have to return a report is easy , I do this: 

return {'type': 'ir.actions.act_window_close'}

How do I print my report and after close the wizard ? 


Thanks


Imagine profil
Abandonează
Cel mai bun răspuns

Hi,
When Odoo launch the download action of a report it will check if close_on_report_download action attribute is set to true, if so it will return action of type ir.actions.act_window_close which will close the wizard.

@api.multi
def print_pdf(self):
action = self.env.ref('customer_products.pdf_products').report_action(self)
action.update({'close_on_report_download': True})
return action

Regards

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
dec. 15
3521
1
apr. 24
581
1
aug. 17
3283
0
iun. 16
3521
3
mar. 16
15018