[FIX] account_banling_pain_base: refactored

This commit is contained in:
Ignacio Ibeas - Acysos S.L.
2014-02-24 18:57:05 +01:00
parent 21d7bebba7
commit 263bea20fb

View File

@@ -45,10 +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 and company_vat[0:2].upper() in ['ES']:
party_identifier = company.sepa_creditor_identifier
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):