Skip on_change_parent on already saved account

Closes #11871
This commit is contained in:
Nicolas Évrard
2023-01-02 22:00:47 +01:00
parent c2a8b8c953
commit 7cbee84611
+2
View File
@@ -1186,6 +1186,8 @@ class Account(
def on_change_parent(self):
if not self.parent:
return
if self.id is not None and self.id >= 0:
return
for field in self.__on_change_parent_fields:
if (not getattr(self, field)
or field in {'reconcile', 'deferral',