Always set year, month, and day tags on MediaFiles in that order
1.3.10

_Immediately_ after 'write'

> $ beet write -p album:Mutations
> Beck - Mutations - Cold Brains
>   original_day: 00 -> 02
>   bitrate: 931kbps -> 931kbps
> Beck - Mutations - Nobody’s Fault but My Own
>   original_day: 00 -> 02
>   bitrate: 902kbps -> 902kbps
> ...

I check the FLAC files and see

>    comment[44]: ORIGINALDATE=1998-11

Issue 1)  original_day wasn't written.
IMO, 'write' should think the db and files are in sync immediately after a 'write'.

Issue 2)  write thinks the bitrate doesn't match.
I'm not sure what FLAC data to look at in the file...

'update' apparently thinks things are in sync.

> $ beet update -p album:Mutations
> $

So 'update' doesn't care about original_day ??

diff --git a/beets/mediafile.py b/beets/mediafile.py
index b2a72d84c..e82b14aae 100644
--- a/beets/mediafile.py
+++ b/beets/mediafile.py
@@ -1460,6 +1460,28 @@ class MediaFile(object):
             if isinstance(descriptor, MediaField):
                 yield property.decode('utf8')
 
+    @classmethod
+    def field_sort_name(cls, name):
+        """Get field name for sorting purposes. Fields names are kept
+        unchanged, unless they are instances of :class:`DateItemField`,
+        in which case `year`, `month`, and `day` are replaced by `date0`,
+        `date1`, and `date2`, respectively.
+        """
+        if isinstance(cls.__dict__[name], DateItemField):
+            name = re.sub('year',  'date0', name)
+            name = re.sub('month', 'date1', name)
+            name = re.sub('day',   'date2', name)
+        return name
+
+    @classmethod
+    def sorted_fields(cls):
+        """Get the names of all writable metadata fields sorted by
+        lexicographic order (except for instances of :class:`DateItemField`,
+        which are sorted in year-month-day order).
+        """
+        for property in sorted(cls.fields(), key=cls.field_sort_name):
+            yield property
+
     @classmethod
     def readable_fields(cls):
         """Get all metadata fields: the writable ones from
@@ -1496,7 +1518,7 @@ class MediaFile(object):
         the `MediaFile`. If a key has the value `None`, the
         corresponding property is deleted from the `MediaFile`.
         """
-        for field in self.fields():
+        for field in self.sorted_fields():
             if field in dict:
                 if dict[field] is None:
                     delattr(self, field)
['beets/mediafile.py']