From 82234e82ba3f3697ea2de01f0ad9eca43bd09c7d Mon Sep 17 00:00:00 2001 From: mpanarin Date: Wed, 27 Mar 2019 17:03:30 +0200 Subject: [PATCH] [IMP] 10.0 bank_payment_order move invoice_ref calculation to python --- account_payment_order/report/account_payment_order.py | 7 +++++++ account_payment_order/report/account_payment_order.xml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/account_payment_order/report/account_payment_order.py b/account_payment_order/report/account_payment_order.py index 1674137e8..6aa3346f7 100644 --- a/account_payment_order/report/account_payment_order.py +++ b/account_payment_order/report/account_payment_order.py @@ -21,6 +21,7 @@ class AccountPaymentOrderReport(models.AbstractModel): 'data': data, 'env': self.env, 'get_bank_account_name': self.get_bank_account_name, + 'get_invoice_ref': self.get_invoice_ref, 'formatLang': formatLang, } return self.env['report'].render( @@ -46,3 +47,9 @@ class AccountPaymentOrderReport(models.AbstractModel): return name else: return False + + @api.model + def get_invoice_ref(self, line): + value = (line.move_line_id.invoice_id.number or + line.move_line_id.move_id.name) + return value or '' diff --git a/account_payment_order/report/account_payment_order.xml b/account_payment_order/report/account_payment_order.xml index 1c9dbc62d..fedef9517 100644 --- a/account_payment_order/report/account_payment_order.xml +++ b/account_payment_order/report/account_payment_order.xml @@ -76,7 +76,7 @@ - +