From f6935ef81ae7076ea8aad9fc3c87f3428b648366 Mon Sep 17 00:00:00 2001 From: Katherine Zaoral Date: Tue, 7 Jul 2020 13:50:45 +0000 Subject: [PATCH] [IMP] account: unify invoice report w/o payments * merge report_invoice_document and report_invoice_document_with_payments templates * define new generic method _get_name_invoice_report that let us to print a different report, this method can be inherited by each localization to set their custom report * change report templates to use the new method. --- addons/account/models/account_move.py | 6 +++ addons/account/views/report_invoice.xml | 54 ++++++++++++------------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 5f69692cff1..99753a10e1d 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -2558,6 +2558,12 @@ class AccountMove(models.Model): raise UserError(_("Only invoices could be printed.")) return self._get_move_display_name() + def _get_name_invoice_report(self): + """ This method need to be inherit by the localizations if they want to print a custom invoice report instead of + the default one. For example please review the l10n_ar module """ + self.ensure_one() + return 'account.report_invoice_document' + def preview_invoice(self): self.ensure_one() return { diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index ce54031ded0..917547a07e9 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -157,6 +157,29 @@ + + + + + + + Paid on + + + + + + + + + Amount Due + + + + + + + @@ -186,37 +209,11 @@ - - @@ -225,7 +222,8 @@ - + +