From d6fb1bf115e00d0e985b5060959f1559d924397e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 14 Jun 2016 22:25:23 +0200 Subject: [PATCH] Move field bank_account_required from module account_payment_partner to account_payment_mode Make the mandate a required field on payment line when the payment method has mandate_required=True Make the bank account a required field on payment line when the payment method has bank_account_required=True Minor code cleanup PEP8 --- .../data/account_payment_method.xml | 1 + .../models/account_payment_order.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/account_banking_sepa_direct_debit/data/account_payment_method.xml b/account_banking_sepa_direct_debit/data/account_payment_method.xml index ff1d28d66..67a3339f6 100644 --- a/account_banking_sepa_direct_debit/data/account_payment_method.xml +++ b/account_banking_sepa_direct_debit/data/account_payment_method.xml @@ -7,6 +7,7 @@ SEPA Direct Debit for customers sepa_direct_debit inbound + pain.008.001.02 diff --git a/account_banking_sepa_direct_debit/models/account_payment_order.py b/account_banking_sepa_direct_debit/models/account_payment_order.py index 38e6daa22..16bd8557b 100644 --- a/account_banking_sepa_direct_debit/models/account_payment_order.py +++ b/account_banking_sepa_direct_debit/models/account_payment_order.py @@ -36,10 +36,10 @@ class AccountPaymentOrder(models.Model): """Creates the SEPA Direct Debit file. That's the important code !""" self.ensure_one() if ( - self.payment_mode_id.payment_method_id.code != + self.payment_method_id.code != 'sepa_direct_debit'): return super(AccountPaymentOrder, self).generate_payment_file() - pain_flavor = self.payment_mode_id.payment_method_id.pain_version + pain_flavor = self.payment_method_id.pain_version # We use pain_flavor.startswith('pain.008.001.xx') # to support country-specific extensions such as # pain.008.001.02.ch.01 (cf l10n_ch_sepa)