← Back to team overview

banking-addons-team team mailing list archive

[Merge] lp:~acsone-openerp/banking-addons/sepa_without_bic into lp:banking-addons

 

Stéphane Bidoul (Acsone) has proposed merging lp:~acsone-openerp/banking-addons/sepa_without_bic into lp:banking-addons.

Requested reviews:
  Banking Addons Core Editors (banking-addons-team)

For more details, see:
https://code.launchpad.net/~acsone-openerp/banking-addons/sepa_without_bic/+merge/186513

[IMP] avoid generating invalid sepa credit transfer files when bank accounts have no BIC.

In the SEPA XSD, the BIC elements are optional, but if they are present they must not be empty.
-- 
https://code.launchpad.net/~acsone-openerp/banking-addons/sepa_without_bic/+merge/186513
Your team Banking Addons Core Editors is requested to review the proposed merge of lp:~acsone-openerp/banking-addons/sepa_without_bic into lp:banking-addons.
=== modified file 'account_banking_sepa_credit_transfer/wizard/export_sepa.py'
--- account_banking_sepa_credit_transfer/wizard/export_sepa.py	2013-08-02 22:39:11 +0000
+++ account_banking_sepa_credit_transfer/wizard/export_sepa.py	2013-09-19 11:54:37 +0000
@@ -211,8 +211,9 @@
         debtor_account_iban.text = my_company_iban
         debtor_agent = etree.SubElement(payment_info, 'DbtrAgt')
         debtor_agent_institution = etree.SubElement(debtor_agent, 'FinInstnId')
-        debtor_agent_bic = etree.SubElement(debtor_agent_institution, bic_xml_tag)
-        debtor_agent_bic.text = my_company_bic
+        if my_company_bic:
+            debtor_agent_bic = etree.SubElement(debtor_agent_institution, bic_xml_tag)
+            debtor_agent_bic.text = my_company_bic
         charge_bearer = etree.SubElement(payment_info, 'ChrgBr')
         charge_bearer.text = sepa_export.charge_bearer
 
@@ -238,10 +239,11 @@
                 amount_control_sum += line.amount_currency
                 creditor_agent = etree.SubElement(credit_transfer_transaction_info, 'CdtrAgt')
                 creditor_agent_institution = etree.SubElement(creditor_agent, 'FinInstnId')
-                creditor_agent_bic = etree.SubElement(creditor_agent_institution, bic_xml_tag)
                 if not line.bank_id:
                     raise orm.except_orm(_('Error :'), _("Missing Bank Account on invoice '%s' (payment order line reference '%s').") %(line.ml_inv_ref.number, line.name))
-                creditor_agent_bic.text = line.bank_id.bank.bic
+                if line.bank_id.bank.bic:
+                    creditor_agent_bic = etree.SubElement(creditor_agent_institution, bic_xml_tag)
+                    creditor_agent_bic.text = line.bank_id.bank.bic
                 creditor = etree.SubElement(credit_transfer_transaction_info, 'Cdtr')
                 creditor_name = etree.SubElement(creditor, 'Nm')
                 creditor_name.text = self._limit_size(cr, uid, line.partner_id.name, name_maxsize, context=context)


Follow ups