fix(#259): handle case of print attachment wizard

The fix in #259 only worked for reports being printed at generation
of the PDF. This PR handles sending an attachment to a printer through
the Print Attachment wizard.

Also clarify the configuration section of the README.
This commit is contained in:
Alexandre Fayolle
2022-03-09 12:00:36 +01:00
parent d6bab25e8c
commit 649c1c2eee
3 changed files with 7 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ class PrintAttachment(models.TransientModel):
errors = []
for att_line in self.attachment_line_ids:
data = att_line.attachment_id.datas
title = att_line.attachment_id.datas_fname
if not data:
errors.append(att_line)
continue
@@ -34,7 +35,8 @@ class PrintAttachment(models.TransientModel):
None,
content=content,
format=content_format,
copies=att_line.copies
copies=att_line.copies,
title=title
)
if errors:
return {