From a8755c51eae85cf81b7d1fe57598281e5a809c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 17 Mar 2013 00:17:19 +0100 Subject: [PATCH] Fix uninitialized new_records in ModelStorage.copy --- trytond/model/modelstorage.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/trytond/model/modelstorage.py b/trytond/model/modelstorage.py index d05aac4ad5..61beeaae6b 100644 --- a/trytond/model/modelstorage.py +++ b/trytond/model/modelstorage.py @@ -295,8 +295,7 @@ class ModelStorage(Model): data, data_o2m = convert_data(field_defs, data) to_create.append(data) o2m_to_create.append(data_o2m) - if to_create: - new_records = cls.create(to_create) + new_records = cls.create(to_create) for data_id, new_record, data_o2m in izip(data_ids, new_records, o2m_to_create): new_ids[data_id] = new_record.id