Use a sentinel as default value for setting attribute only if changed

For new instances, we must set also the attribute with value `None` as they may
be tested later.

Closes #15060
(grafted from bfe3756af384f4fce94244761d5f5dd3f62d0ff6)

--HG--
branch : 8.0
This commit is contained in:
Cédric Krier
2026-09-03 15:49:20 +02:00
parent 4e4d7b0729
commit 0512626e26
+1 -1
View File
@@ -188,6 +188,6 @@ class IdentifiersMixin(IdentifiersUpdateMixin):
def setattr_changed(record, name, value):
if getattr(record, name, None) != value:
if getattr(record, name, object()) != value:
setattr(record, name, value)
return True