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 : 7.0
This commit is contained in:
Cédric Krier committed 2026-09-03 15:49:20 +02:00
1 parent 21f549d531
commit 5e211dd515
1 file changed
+1 -1
+1 -1
View File
@@ -160,6 +160,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