From 16d382ec4211f124c8d82ae959db6f1873710f9f Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 3 Nov 2020 18:03:02 +0100 Subject: [PATCH] Don't mark invoice as 'sent' when you just click on 'Print Invoice' --- account_usability/account.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/account_usability/account.py b/account_usability/account.py index 2cab520..15e5c8c 100644 --- a/account_usability/account.py +++ b/account_usability/account.py @@ -146,6 +146,13 @@ class AccountInvoice(models.Model): attach.id, attach.name) logger.info('END fix customer invoice attachment filename') + @api.multi + def invoice_print(self): + # Inherit a native method without calling super() + # Don't mark invoice as 'sent' when you just click on 'Print Invoice' + self.ensure_one() + return self.env['report'].get_action(self, 'account.report_invoice') + class AccountInvoiceLine(models.Model): _inherit = 'account.invoice.line'