From d05b4047966cd8b899dddf88431d2e24ae70d734 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 23 Jul 2016 00:21:07 +0200 Subject: [PATCH] [FIX] account_payment_order: 4 things: * Fix crash when selecting a customer that has a direct debit payment mode but no mandate * Hide many fields when payment_order_ok is False on a payment_mode * Fix payment line communication when the move line is not linked to an invoice (problem found when porting donation_debit_debit to v9) * For the communication field, if self.move_id.ref is False, fallback on self.move_id.name --- .../models/account_move_line.py | 2 +- .../views/account_payment_mode.xml | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/account_payment_order/models/account_move_line.py b/account_payment_order/models/account_move_line.py index d87b57351..fa4578e7f 100644 --- a/account_payment_order/models/account_move_line.py +++ b/account_payment_order/models/account_move_line.py @@ -23,7 +23,7 @@ class AccountMoveLine(models.Model): aplo = self.env['account.payment.line'] # default values for communication_type and communication communication_type = 'normal' - communication = self.move_id.name or '-' + communication = self.move_id.ref or self.move_id.name # change these default values if move line is linked to an invoice if self.invoice_id: if self.invoice_id.reference_type != 'none': diff --git a/account_payment_order/views/account_payment_mode.xml b/account_payment_order/views/account_payment_mode.xml index 951c59bf3..966f7b987 100644 --- a/account_payment_order/views/account_payment_mode.xml +++ b/account_payment_order/views/account_payment_mode.xml @@ -8,21 +8,29 @@ account.payment.mode + + + - - + - + - +