From f58368210c9c962c84cdcd2e2a799c5fc6183a13 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 28 Aug 2019 13:02:23 +0000 Subject: [ADD] base_import: batching (& some other features) various UI changes ------------------ * renamed "test import" button to "test" * move relation fields thing to debug mode * remove "Defer parent/child computation" option as it was deprecated / removed from the backend in 80f1ac3599ee630e7556ff4fcf3eb192931eccd8, turns out this checkbox existed inactive for longer than it's been of any use (added in 68cb2ade09206b0abb3f7c8dccb5d35a6499f802 on 2017-11-29, made non-operating on 2018-01-24, that's so sad) batching -------- * add support for batching imports (skip & limit parameters) * modify client to use batched imports & properly adapt responses so it still looks like a single import for the client (more or less) e.g. update row numbers in error messages, etc... * properly handle partial imports though * disable usual loading throbber to have a single progress notification displayed continuously throughout all the batches: the normal throbber only shows after 3s of waiting for an RPC response, so it would keep flashing in and out (appear 3s into a batch's import then disappear at the end only to reappear 3s into the next batch's loading) NOTE: the limit is row-wise. If a record straddles the limit (because of nested O2M records), the record is imported in full and the "next row" is whatever row follows the record. This means a limit of 10 can lead to an import of 17 lines, and as the progress indicator is in records# the increments can jump around. Task 2059448 --- addons/base_import/static/src/xml/base_import.xml | 72 +++++++++++++---------- 1 file changed, 42 insertions(+), 30 deletions(-) (limited to 'addons/base_import/static/src/xml/base_import.xml') diff --git a/addons/base_import/static/src/xml/base_import.xml b/addons/base_import/static/src/xml/base_import.xml index 6d69d6995aa..aa0e956f9fd 100644 --- a/addons/base_import/static/src/xml/base_import.xml +++ b/addons/base_import/static/src/xml/base_import.xml @@ -4,7 +4,7 @@
-
+
@@ -36,34 +36,45 @@
+
+ Due to its large size, the file will be imported by batches. +
+
+ Click 'Resume' to proceed with the import, resuming at line + 0.
+ You can test or reload your file before resuming the import. +
-
+

Map your columns to import

-
- - -
-
- - +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
- - - -

If the file contains the column names, Odoo can try auto-detecting the field corresponding to the column. This makes imports @@ -95,8 +106,9 @@ - - + + + @@ -132,7 +144,7 @@ -

+

Import preview failed due to: .

For CSV files, you may need to select the correct separator.

Here is the start of the file we could not import:

@@ -141,7 +153,7 @@
  • + t-attf-class="oe_import_report alert alert-#{error_value[0].type}"> -- cgit v1.2.3