From 467ce47306adc08b75888d9ac22a6a565b3c230c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Fri, 27 Sep 2024 17:11:39 +0200 Subject: [PATCH] account_invoice_update_wizard: purge existing pdf in attachment after update --- account_invoice_update_wizard/wizard/account_move_update.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/account_invoice_update_wizard/wizard/account_move_update.py b/account_invoice_update_wizard/wizard/account_move_update.py index 98c0ba3..cbd540e 100644 --- a/account_invoice_update_wizard/wizard/account_move_update.py +++ b/account_invoice_update_wizard/wizard/account_move_update.py @@ -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