From 8ef2cc9b7066f58445e709ebbe00d6f5c15c4d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 17 Dec 2025 16:13:44 +0100 Subject: [PATCH] Do not notify for duplicate identifier from the same party Closes #14434 --- modules/party/party.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/party/party.py b/modules/party/party.py index 57b11b679e..e234696b9c 100644 --- a/modules/party/party.py +++ b/modules/party/party.py @@ -917,13 +917,14 @@ class Identifier(sequence_ordered(), DeactivableMixin, ModelSQL, ModelView): notifications.extend(self._notify_duplicate()) return notifications - @fields.depends('code', methods=['on_change_with_code']) + @fields.depends('party', 'code', methods=['on_change_with_code']) def _notify_duplicate(self): cls = self.__class__ if self.code: code = self.on_change_with_code() others = cls.search([ ('id', '!=', self.id), + ('party', '!=', self.party), ('type', '!=', None), ('code', '=', code), ], limit=1)