details:   https://code.tryton.org/tryton/commit/ba15a67c6c7d
branch:    default
user:      Cédric Krier <[email protected]>
date:      Fri Jan 30 11:20:26 2026 +0100
description:
        Set required on value of party's contact mechanism

        Closes #14563
diffstat:

 modules/party/contact_mechanism.py           |  2 +-
 modules/party/party.py                       |  4 ++--
 modules/party/tests/scenario_party_erase.rst |  1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r a5d5b0dbde6a -r ba15a67c6c7d modules/party/contact_mechanism.py
--- a/modules/party/contact_mechanism.py        Mon Jan 26 15:55:53 2026 +0100
+++ b/modules/party/contact_mechanism.py        Fri Jan 30 11:20:26 2026 +0100
@@ -74,7 +74,7 @@
     type = fields.Selection(_TYPES, "Type", required=True, sort=False)
     type_string = type.translated('type')
     value = fields.Char(
-        "Value",
+        "Value", required=True,
         # Add all function fields to ensure to always fill them via on_change
         depends={
             'email', 'website', 'skype', 'sip', 'other_value',
diff -r a5d5b0dbde6a -r ba15a67c6c7d modules/party/party.py
--- a/modules/party/party.py    Mon Jan 26 15:55:53 2026 +0100
+++ b/modules/party/party.py    Fri Jan 30 11:20:26 2026 +0100
@@ -1218,8 +1218,8 @@
                     'postal_code', 'city', 'country', 'subdivision'],
                 [None] * 14),
             (ContactMechanism, [('party', '=', party_id)], True,
-                ['value', 'name', 'comment'],
-                [None, None, None]),
+                ['type', 'value', 'name', 'comment'],
+                ['other', '****', None, None]),
             ]
 
     @classmethod
diff -r a5d5b0dbde6a -r ba15a67c6c7d 
modules/party/tests/scenario_party_erase.rst
--- a/modules/party/tests/scenario_party_erase.rst      Mon Jan 26 15:55:53 
2026 +0100
+++ b/modules/party/tests/scenario_party_erase.rst      Fri Jan 30 11:20:26 
2026 +0100
@@ -59,5 +59,6 @@
     >>> address.city
     >>> contact_mechanism.reload()
     >>> contact_mechanism.value
+    '****'
     >>> Attachment.find()
     []

Reply via email to