From 8c691e6148cb960586e40bc6be86dbda58b9f151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 10 Dec 2014 16:51:48 +0100 Subject: [PATCH] sepa credit tfr: get BIC from bank account if not available on bank Since the bank is optional on bank accounts and the BIC can be set on the bank account if there is no bank, we allow the system to get the BIC from the bank account in case it is not on the bank. We give priority to the BIC indicated on the bank, keeping the same behaviour with existing data where the bank BIC is available. --- account_banking_sepa_credit_transfer/wizard/export_sepa.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/account_banking_sepa_credit_transfer/wizard/export_sepa.py b/account_banking_sepa_credit_transfer/wizard/export_sepa.py index 94b2004a3..c9e941e54 100644 --- a/account_banking_sepa_credit_transfer/wizard/export_sepa.py +++ b/account_banking_sepa_credit_transfer/wizard/export_sepa.py @@ -195,7 +195,8 @@ class BankingExportSepaWizard(orm.TransientModel): 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.' 'name', 'sepa_export.payment_order_ids[0].mode.bank_id.acc_number', - 'sepa_export.payment_order_ids[0].mode.bank_id.bank.bic', + 'sepa_export.payment_order_ids[0].mode.bank_id.bank.bic or ' + 'sepa_export.payment_order_ids[0].mode.bank_id.bank_bic', {'sepa_export': sepa_export}, gen_args, context=context) charge_bearer_2_24 = etree.SubElement(payment_info_2_0, 'ChrgBr') @@ -236,7 +237,8 @@ class BankingExportSepaWizard(orm.TransientModel): self.generate_party_block( cr, uid, credit_transfer_transaction_info_2_27, 'Cdtr', 'C', 'line.partner_id.name', 'line.bank_id.acc_number', - 'line.bank_id.bank.bic', {'line': line}, gen_args, + 'line.bank_id.bank.bic or ' + 'line.bank_id.bank_bic', {'line': line}, gen_args, context=context) self.generate_remittance_info_block( cr, uid, credit_transfer_transaction_info_2_27,