Process on a copy of imported data

The process_lines of ModelStorage.import_data pop rows when importing One2Many.
But if the transaction has to be restarted for example if a lock is needed, the
original data from the request has been altered for the second call losing some
or all the data to be imported.

Closes #13984
(grafted from 2cb96c1427d7c0edcb1c9b5b410e220db3f8958e)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2025-04-28 10:49:34 +02:00
1 parent b9f09c4cb0
commit 690f3757a3
1 file changed
+2 -1
+2 -1
View File
@@ -1113,7 +1113,8 @@ class ModelStorage(Model):
to_create, to_create_translations = [], []
to_write, to_write_translations = [], []
languages = set()
while len(data):
data = data.copy()
while data:
(row, _, translate) = \
process_lines(data, [], fields_def)
if dispatch(to_create, to_write, row):