changeset 50b4ba7f33f3 in modules/party:6.4
details: https://hg.tryton.org/modules/party?cmd=changeset&node=50b4ba7f33f3
description:
        Avoid duplicated emails in party and contact mechanism default email

        issue11506
        review427221003
        (grafted from bc92627b6fc9be0da22fb51ba50ee7db4f228fe3)
diffstat:

 ir.py |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (22 lines):

diff -r c363844fb5e1 -r 50b4ba7f33f3 ir.py
--- a/ir.py     Mon May 02 16:45:57 2022 +0200
+++ b/ir.py     Wed May 25 17:48:20 2022 +0200
@@ -52,6 +52,18 @@
             'party.party', 'party.contact_mechanism']
 
     @classmethod
+    def _get_default_exclude(cls, record):
+        pool = Pool()
+        Party = pool.get('party.party')
+        ContactMechanism = pool.get('party.contact_mechanism')
+        exclude = super()._get_default_exclude(record)
+        if isinstance(record, Party):
+            exclude.append('contact_mechanisms')
+        if isinstance(record, ContactMechanism):
+            exclude.append('party')
+        return exclude
+
+    @classmethod
     def _get_address(cls, record):
         pool = Pool()
         Party = pool.get('party.party')

Reply via email to