FIX adapt to issue10053

This commit is contained in:
Raimon Esteve 2021-04-07 12:41:28 +02:00
parent e513bf349b
commit 2b0780e142
1 changed files with 51 additions and 10 deletions

View File

@ -383,11 +383,39 @@
+ <label name="identifier_types"/> + <label name="identifier_types"/>
+ <field name="identifier_types"/> + <field name="identifier_types"/>
</form> </form>
diff --git a/trytond/trytond/modules/account_payment_sepa/__init__.py b/trytond/trytond/modules/account_payment_sepa/__init__.py
index 17457a9..feee60a 100644
--- a/trytond/trytond/modules/account_payment_sepa/__init__.py
+++ b/trytond/trytond/modules/account_payment_sepa/__init__.py
@@ -13,6 +13,7 @@ def register():
payment.Mandate,
payment.Payment,
payment.Message,
+ party.Configuration,
party.Party,
party.PartyIdentifier,
account.Configuration,
diff --git a/trytond/trytond/modules/account_payment_sepa/party.py b/trytond/trytond/modules/account_payment_sepa/party.py diff --git a/trytond/trytond/modules/account_payment_sepa/party.py b/trytond/trytond/modules/account_payment_sepa/party.py
index 2b7c16c..7296268 100644 index 2b7c16c..54de8d7 100644
--- a/trytond/trytond/modules/account_payment_sepa/party.py --- a/trytond/trytond/modules/account_payment_sepa/party.py
+++ b/trytond/trytond/modules/account_payment_sepa/party.py +++ b/trytond/trytond/modules/account_payment_sepa/party.py
@@ -85,11 +85,6 @@ class PartyIdentifier(metaclass=PoolMeta): @@ -16,6 +16,15 @@ from trytond.modules.party.exceptions import InvalidIdentifierCode
from .exceptions import PartyIdentificationdError
+class Configuration(metaclass=PoolMeta):
+ __name__ = 'party.configuration'
+
+ @classmethod
+ def __setup__(cls):
+ super().__setup__()
+ cls.identifier_types.selection += [('sepa', 'SEPA Creditor Identifier')]
+
+
class Party(metaclass=PoolMeta):
__name__ = 'party.party'
sepa_creditor_identifier_used = fields.Function(fields.Char(
@@ -85,11 +94,6 @@ class PartyIdentifier(metaclass=PoolMeta):
}, },
depends=['type']) depends=['type'])
@ -399,12 +427,25 @@ index 2b7c16c..7296268 100644
@fields.depends('party', '_parent_party.identifiers') @fields.depends('party', '_parent_party.identifiers')
def check_code(self): def check_code(self):
super(PartyIdentifier, self).check_code() super(PartyIdentifier, self).check_code()
@@ -129,3 +124,8 @@ class PartyIdentifier(metaclass=PoolMeta): diff --git a/trytond/trytond/modules/account_payment_sepa/tests/test_account_payment_sepa.py b/trytond/trytond/modules/account_payment_sepa/tests/test_account_payment_sepa.py
elif self.type == 'es_nif': index 35ddddc..10e1337 100644
identifier['Id'] += self.sepa_es_suffix or '000' --- a/trytond/trytond/modules/account_payment_sepa/tests/test_account_payment_sepa.py
return identifier +++ b/trytond/trytond/modules/account_payment_sepa/tests/test_account_payment_sepa.py
@@ -150,6 +150,17 @@ class AccountPaymentSepaTestCase(ModuleTestCase):
'Test Account Payment SEPA module'
module = 'account_payment_sepa'
+ @with_transaction()
+ def test_party_identifiers(self):
+ 'Party Identifiers'
+ pool = Pool()
+ Configuration = pool.get('party.configuration')
+ PartyIdentifier = pool.get('party.identifier')
+ +
+ @classmethod + _TYPE = ('sepa', 'SEPA Creditor Identifier')
+ def get_types(cls): + self.assertTrue(_TYPE in Configuration.identifier_types.selection)
+ return super(PartyIdentifier, cls).get_types() + [ + self.assertTrue(_TYPE in PartyIdentifier.get_types())
+ ('sepa', 'SEPA Creditor Identifier')] +
@with_transaction()
def test_pain001_001_03(self):
'Test pain001.001.03 xsd validation'