Reset cache when restore history of ModelSQL

Closes #5086
This commit is contained in:
Cédric Krier committed 2023-02-20 23:03:59 +01:00
1 parent f7f597a150
commit 2b0dcbc3c9
1 file changed
+8
+8
View File
@@ -643,6 +643,14 @@ class ModelSQL(ModelStorage):
cursor = transaction.connection.cursor()
table = cls.__table__()
history = cls.__table_history__()
transaction.counter += 1
for cache in transaction.cache.values():
if cls.__name__ in cache:
cache_cls = cache[cls.__name__]
for id_ in ids:
cache_cls.pop(id_, None)
columns = []
hcolumns = []
fnames = sorted(n for n, f in cls._fields.items()