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

Proposed by Stéphane Bidoul (Acsone)
Status: Merged
Merged at revision: 186
Proposed branch: lp:~acsone-openerp/banking-addons/sepa_without_bic
Merge into: lp:banking-addons
Diff against target: 29 lines (+6/-4)
1 file modified
account_banking_sepa_credit_transfer/wizard/export_sepa.py (+6/-4)
To merge this branch: bzr merge lp:~acsone-openerp/banking-addons/sepa_without_bic
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) Approve
Laurent Mignon (Acsone) (community) code review, no test Approve
Pedro Manuel Baeza code review, no test Approve
Review via email: mp+186513@code.launchpad.net

Description of the change

[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.

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Laurent Mignon (Acsone) (lmi) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks! The person merging this change should backport this change to 6.1 as well, using a cherrypicking merge:

bzr merge lp:~acsone-openerp/banking-addons/sepa_without_bic -r 185..186

review: Approve
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Should I merge the MP then? In community-review draft, it is said that "The person who approve a Merge proposal shouldn’t merge it himself, a third person must do it", but I'm not sure if this is correct and practical.

Regards.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Pedro,

please go ahead! The quote from the draft is obviously a mistake. The correct guideline is: No one should merge their own proposals, as it says in the proposal here now: https://code.launchpad.net/~openerp-community/openobject-doc/7.0-community-review/+merge/186295

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Merged and backported!!

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thank you Pedro for the merges!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_banking_sepa_credit_transfer/wizard/export_sepa.py'
2--- account_banking_sepa_credit_transfer/wizard/export_sepa.py 2013-08-02 22:39:11 +0000
3+++ account_banking_sepa_credit_transfer/wizard/export_sepa.py 2013-09-19 11:54:37 +0000
4@@ -211,8 +211,9 @@
5 debtor_account_iban.text = my_company_iban
6 debtor_agent = etree.SubElement(payment_info, 'DbtrAgt')
7 debtor_agent_institution = etree.SubElement(debtor_agent, 'FinInstnId')
8- debtor_agent_bic = etree.SubElement(debtor_agent_institution, bic_xml_tag)
9- debtor_agent_bic.text = my_company_bic
10+ if my_company_bic:
11+ debtor_agent_bic = etree.SubElement(debtor_agent_institution, bic_xml_tag)
12+ debtor_agent_bic.text = my_company_bic
13 charge_bearer = etree.SubElement(payment_info, 'ChrgBr')
14 charge_bearer.text = sepa_export.charge_bearer
15
16@@ -238,10 +239,11 @@
17 amount_control_sum += line.amount_currency
18 creditor_agent = etree.SubElement(credit_transfer_transaction_info, 'CdtrAgt')
19 creditor_agent_institution = etree.SubElement(creditor_agent, 'FinInstnId')
20- creditor_agent_bic = etree.SubElement(creditor_agent_institution, bic_xml_tag)
21 if not line.bank_id:
22 raise orm.except_orm(_('Error :'), _("Missing Bank Account on invoice '%s' (payment order line reference '%s').") %(line.ml_inv_ref.number, line.name))
23- creditor_agent_bic.text = line.bank_id.bank.bic
24+ if line.bank_id.bank.bic:
25+ creditor_agent_bic = etree.SubElement(creditor_agent_institution, bic_xml_tag)
26+ creditor_agent_bic.text = line.bank_id.bank.bic
27 creditor = etree.SubElement(credit_transfer_transaction_info, 'Cdtr')
28 creditor_name = etree.SubElement(creditor, 'Nm')
29 creditor_name.text = self._limit_size(cr, uid, line.partner_id.name, name_maxsize, context=context)

Subscribers

People subscribed via source and target branches

to status/vote changes: