[FIX] account: fix reset to draft report deletion
When removing the "Save as Attachment Prefix" field of the Invoice report (`account.report_invoice`), it was no longer possible to reset the invoice to draft opw-687130
This commit is contained in:
@@ -522,7 +522,7 @@ class AccountInvoice(models.Model):
|
||||
report_invoice = self.env['report']._get_report_from_name('account.report_invoice')
|
||||
except IndexError:
|
||||
report_invoice = False
|
||||
if report_invoice:
|
||||
if report_invoice and report_invoice.attachment:
|
||||
for invoice in self:
|
||||
with invoice.env.do_in_draft():
|
||||
invoice.number, invoice.state = invoice.move_name, 'open'
|
||||
|
||||
Reference in New Issue
Block a user