Do not notify for duplicate identifier from the same party

Closes #14434
This commit is contained in:
Cédric Krier committed 2025-12-17 16:13:44 +01:00
1 parent d8981ef84d
commit 8ef2cc9b70
1 file changed
+2 -1
+2 -1
View File
@@ -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)