diff --git a/addons/account/controllers/portal.py b/addons/account/controllers/portal.py index 3fa31df4899..91c014e8dfb 100644 --- a/addons/account/controllers/portal.py +++ b/addons/account/controllers/portal.py @@ -131,7 +131,7 @@ class PortalAccount(CustomerPortal): except (AccessError, MissingError): return request.redirect('/my') - if report_type == 'pdf' and download: + if report_type == 'pdf' and download and invoice_sudo.state == 'posted': # Send & Print wizard with only the 'download' checkbox to get the official attachment(s) template = request.env.ref(invoice_sudo._get_mail_template()) attachment_ids = invoice_sudo._generate_pdf_and_send_invoice(template, bypass_download=True, checkbox_send_mail=False, checkbox_download=True)