Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions partner_communication/models/communication_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,12 @@ def preview_pdf(self):
"target": "new",
}

def preview_pdf_report(self):
self.ensure_one()
return self.report_id.with_context(
lang=self.partner_id.lang, must_skip_send_to_printer=True
).report_action(self.ids, config=False)

def download_data(self):
action = {
"type": "ir.actions.act_window",
Expand Down
8 changes: 8 additions & 0 deletions partner_communication/views/communication_job_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
icon="fa-search-plus"
class="oe_stat_button"
invisible="state != 'pending'"
/>
<button
name="preview_pdf_report"
string="Preview PDF"
type="object"
icon="fa-file-pdf-o"
class="oe_stat_button"
invisible="state != 'pending' or not report_id"
/>
<button
name="open_related"
Expand Down
Loading