From 9512d3de3ae01824145f9ec6b1e445fe1017abb2 Mon Sep 17 00:00:00 2001 From: andreparames Date: Wed, 18 Jul 2018 16:06:38 +0100 Subject: [PATCH] [ADD] sepa: add Instruction Identification field InstrId is optional, so there should be no harm in adding it always, with the same value as EndToEndId. --- .../models/account_payment_order.py | 5 +++++ .../models/account_payment_order.py | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/account_banking_sepa_credit_transfer/models/account_payment_order.py b/account_banking_sepa_credit_transfer/models/account_payment_order.py index 44de57d54..df6ccba36 100644 --- a/account_banking_sepa_credit_transfer/models/account_payment_order.py +++ b/account_banking_sepa_credit_transfer/models/account_payment_order.py @@ -130,6 +130,11 @@ class AccountPaymentOrder(models.Model): payment_info, 'CdtTrfTxInf') payment_identification = etree.SubElement( credit_transfer_transaction_info, 'PmtId') + instruction_identification = etree.SubElement( + payment_identification, 'InstrId') + instruction_identification.text = self._prepare_field( + 'Instruction Identification', 'line.name', + {'line': line}, 35, gen_args=gen_args) end2end_identification = etree.SubElement( payment_identification, 'EndToEndId') end2end_identification.text = self._prepare_field( 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 4e92c1260..58b142302 100644 --- a/account_banking_sepa_direct_debit/models/account_payment_order.py +++ b/account_banking_sepa_direct_debit/models/account_payment_order.py @@ -156,12 +156,11 @@ class AccountPaymentOrder(models.Model): payment_info, 'DrctDbtTxInf') payment_identification = etree.SubElement( dd_transaction_info, 'PmtId') - if pain_flavor == 'pain.008.001.02.ch.01': - instruction_identification = etree.SubElement( - payment_identification, 'InstrId') - instruction_identification.text = self._prepare_field( - 'Intruction Identification', 'line.name', - {'line': line}, 35, gen_args=gen_args) + instruction_identification = etree.SubElement( + payment_identification, 'InstrId') + instruction_identification.text = self._prepare_field( + 'Instruction Identification', 'line.name', + {'line': line}, 35, gen_args=gen_args) end2end_identification = etree.SubElement( payment_identification, 'EndToEndId') end2end_identification.text = self._prepare_field(