Skip to content

Commit 2a0b134

Browse files
Merge pull request #222 from akretion/14-fix-invoice-update-pdf-unlink
[FIX] account_invoice_update_wizard : avoid stacktrace when no pdf is…
2 parents 4c067fe + db33820 commit 2a0b134

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

account_invoice_update_wizard/wizard/account_move_update.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ def run(self):
229229
'wizard.'))
230230
# Purge existing PDF
231231
report = self.env.ref("account.account_invoices")
232-
report.retrieve_attachment(inv).unlink()
232+
attachment = report.retrieve_attachment(inv)
233+
# attachment may be None
234+
if attachment:
235+
attachment.unlink()
233236
return True
234237

235238

0 commit comments

Comments
 (0)