Do not notify for duplicate identifier from the same party
Closes #14434
This commit is contained in:
1 parent
d8981ef84d
commit
8ef2cc9b70
1 file changed
+2
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user