account_invoice_update_wizard: purge existing pdf in attachment after update

This commit is contained in:
Sébastien BEAU
2024-09-27 17:11:39 +02:00
parent bade674c41
commit 467ce47306

View File

@@ -226,6 +226,9 @@ class AccountMoveUpdate(models.TransientModel):
inv.message_post(body=_(
'Non-legal fields of invoice updated via the Invoice Update '
'wizard.'))
# Purge existing PDF
report = self.env.ref("account.account_invoices")
report.retrieve_attachment(inv).unlink()
return True