details: https://code.tryton.org/tryton/commit/031f18299720
branch: default
user: Cédric Krier <[email protected]>
date: Fri Sep 19 17:24:36 2025 +0200
description:
Allow customization of the types of identifiers permitted on the address
Closes #14247
diffstat:
modules/party/address.py | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diffs (38 lines):
diff -r 09e406583db0 -r 031f18299720 modules/party/address.py
--- a/modules/party/address.py Thu Sep 18 14:12:16 2025 +0200
+++ b/modules/party/address.py Fri Sep 19 17:24:36 2025 +0200
@@ -135,11 +135,7 @@
full_address = fields.Function(fields.Text('Full Address'),
'get_full_address')
identifiers = fields.One2Many(
- 'party.identifier', 'address', "Identifiers",
- domain=[
- ('party', '=', Eval('party', -1)),
- ('type', 'in', ['fr_siret']),
- ])
+ 'party.identifier', 'address', "Identifiers")
contact_mechanisms = fields.One2Many(
'party.contact_mechanism', 'address', "Contact Mechanisms",
domain=[
@@ -155,6 +151,10 @@
autocomplete_postal_code=RPC(instantiate=0, cache=dict(days=1)),
autocomplete_city=RPC(instantiate=0, cache=dict(days=1)),
)
+ cls.identifiers.domain = [
+ ('party', '=', Eval('party', -1)),
+ ('type', 'in', list(cls._type_identifiers())),
+ ]
@classmethod
def __register__(cls, module_name):
@@ -364,6 +364,10 @@
return substitutions
@classmethod
+ def _type_identifiers(cls):
+ return {'fr_siret'}
+
+ @classmethod
def _strip(cls, value, doublespace=False):
value = re.sub(
r'[\,\/,–][\s,\,\/]*([\,\/,–])', r'\1', value, flags=re.MULTILINE)