From 4345ba088d4543b17be6a67392f3562c3a5145e0 Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Thu, 13 Jul 2023 13:01:23 +0000 Subject: [PATCH] [IMP] account: Improve PDF reports to ease the overrides closes odoo/odoo#128395 Task: 3069324 Related: odoo/enterprise#44052 Related: odoo/upgrade#4942 Signed-off-by: Laurent Smet (las) --- addons/account/models/account_payment.py | 13 ++++++++++ addons/account/views/report_invoice.xml | 14 +++++------ .../report_payment_receipt_templates.xml | 24 +++++++++++-------- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 9f6890b487e..dcaf0e4700b 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -917,6 +917,19 @@ class AccountPayment(models.Model): lambda l: l.account_id == payment.destination_account_id and not l.reconciled) lines.reconcile() + def _get_payment_receipt_report_values(self): + """ Get the extra values when rendering the Payment Receipt PDF report. + + :return: A dictionary: + * display_invoices: Display the invoices table. + * display_payment_method: Display the payment method value. + """ + self.ensure_one() + return { + 'display_invoices': True, + 'display_payment_method': True, + } + # ------------------------------------------------------------------------- # BUSINESS METHODS # ------------------------------------------------------------------------- diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index c4fdeae7838..e3debee37b2 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -108,7 +108,7 @@ Description Quantity Unit Price - + Disc.% Taxes @@ -132,23 +132,23 @@ - + - + - + - + - + - + diff --git a/addons/account/views/report_payment_receipt_templates.xml b/addons/account/views/report_payment_receipt_templates.xml index b9773c9ff52..c346692412e 100644 --- a/addons/account/views/report_payment_receipt_templates.xml +++ b/addons/account/views/report_payment_receipt_templates.xml @@ -3,10 +3,11 @@