Add the party identifier support for Spain.

This commit is contained in:
unknown
2014-03-01 15:52:57 +01:00
committed by Stefan Rijnhart

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):