changeset 4987942f0c2e in modules/party:6.2
details: https://hg.tryton.org/modules/party?cmd=changeset&node=4987942f0c2e
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 129a38526881 -r 4987942f0c2e ir.py
--- a/ir.py     Mon Nov 01 17:03:38 2021 +0100
+++ 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