mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] account_banking_pain_base: Set a general rule for the initiating party identifier
This commit is contained in:
committed by
Enric Tobella
parent
96d2ba0318
commit
f4f8e6c8f3
@@ -44,13 +44,11 @@ class ResCompany(orm.Model):
|
|||||||
assert isinstance(company_id, int), 'Only one company ID'
|
assert isinstance(company_id, int), 'Only one company ID'
|
||||||
company = self.browse(cr, uid, company_id, context=context)
|
company = self.browse(cr, uid, company_id, context=context)
|
||||||
company_vat = company.vat
|
company_vat = company.vat
|
||||||
party_identifier = False
|
party_identifier = company.sepa_creditor_identifier
|
||||||
if company_vat:
|
if not party_identifier and company_vat:
|
||||||
country_code = company_vat[0:2].upper()
|
country_code = company_vat[0:2].upper()
|
||||||
if country_code == 'BE':
|
if country_code == 'BE':
|
||||||
party_identifier = company_vat[2:].replace(' ', '')
|
party_identifier = company_vat[2:].replace(' ', '')
|
||||||
elif country_code == 'ES':
|
|
||||||
party_identifier = company.sepa_creditor_identifier
|
|
||||||
return party_identifier
|
return party_identifier
|
||||||
|
|
||||||
def _initiating_party_issuer_default(self, cr, uid, context=None):
|
def _initiating_party_issuer_default(self, cr, uid, context=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user