Change Type
Addition
Area
Functionality/features
Proposed Changes
The documentation page for Custom Scripts covers how to create new objects, but doesn't cover the caveats when updating an existing object.
Suggestion
Writing Custom Scripts
....the already existing text...
To generate the correct change log data when editing an existing object, a snapshot of the object must be taken before making any changes to the object.
if obj.pk and hasattr(obj, 'snapshot'):
obj.snapshot()
obj.property = "New Value"
obj.save()