[FIX] account_banking_pain_base: support party identifier for Spain

This commit is contained in:
Ignacio Ibeas - Acysos S.L
2014-02-13 17:21:09 +01:00
committed by Pedro M. Baeza
parent e8fe4fd2d0
commit 39805fb08b
2 changed files with 14 additions and 5 deletions

View File

@@ -40,11 +40,16 @@
Base module for PAIN file generation
====================================
This module contains fields and functions that are used by the module for SEPA Credit Transfer (account_banking_sepa_credit_transfer) and SEPA Direct Debit (account_banking_sepa_direct_debit). This module doesn't provide any functionnality by itself.
This module contains fields and functions that are used by the module for SEPA
Credit Transfer (account_banking_sepa_credit_transfer) and SEPA Direct Debit
(account_banking_sepa_direct_debit). This module doesn't provide any
functionnality by itself.
This module is part of the banking addons: https://launchpad.net/banking-addons
This module is part of the banking addons:
https://www.github.com/OCA/banking-addons
This module was started during the Akretion-Noviat code sprint of November 21st 2013 in Epiais les Louvres (France).
This module was started during the Akretion-Noviat code sprint of
November 21st 2013 in Epiais les Louvres (France).
''',
'active': False,
'installable': True,

View File

@@ -45,8 +45,12 @@ class res_company(orm.Model):
company = self.browse(cr, uid, company_id, context=context)
company_vat = company.vat
party_identifier = False
if company_vat and company_vat[0:2].upper() in ['BE']:
party_identifier = company_vat[2:].replace(' ', '')
if company_vat:
country_code = company_vat[0:2].upper()
if country_code == 'BE':
party_identifier = company_vat[2:].replace(' ', '')
elif country_code == 'ES':
party_identifier = company.sepa_creditor_identifier
return party_identifier
def _initiating_party_issuer_default(self, cr, uid, context=None):