From c2d3e2feaae6a4c475225c9dfbe72838e8d23922 Mon Sep 17 00:00:00 2001 From: hparfr Date: Wed, 29 Mar 2023 18:30:44 +0200 Subject: [PATCH] pattern_import_export: no data is success --- pattern_import_export/models/pattern_file.py | 5 +++++ pattern_import_export/readme/CONTRIBUTORS.rst | 1 + 2 files changed, 6 insertions(+) diff --git a/pattern_import_export/models/pattern_file.py b/pattern_import_export/models/pattern_file.py index ccbe4879..ab6e6912 100644 --- a/pattern_import_export/models/pattern_file.py +++ b/pattern_import_export/models/pattern_file.py @@ -170,6 +170,11 @@ def split_in_chunk(self): previous_idx = idx if items: self._create_chunk(start_idx, idx, items) + else: + # document has an header and no data lines + # valid document. So create a dummy chunk + # to have progression and status + self._create_chunk(-1, -1, []) except Exception as e: self.state = "failed" self.info = _("Failed to create the chunk: %s") % e diff --git a/pattern_import_export/readme/CONTRIBUTORS.rst b/pattern_import_export/readme/CONTRIBUTORS.rst index bd541f8a..f720d113 100644 --- a/pattern_import_export/readme/CONTRIBUTORS.rst +++ b/pattern_import_export/readme/CONTRIBUTORS.rst @@ -2,3 +2,4 @@ * Sébastien Beau * François Honoré (ACSONE SA/NV) * Kevin Khao +* Raphaël Reverdy