Do not notify for duplicate identifier from the same party

Closes #14434
(grafted from 33e65be32c54cf8ba9f2fb680541ef74aec7b420)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2025-12-17 16:13:44 +01:00
parent 9f65df770a
commit 4859f41139
+2 -1
View File
@@ -851,13 +851,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)