summaryrefslogtreecommitdiff
path: root/addons/base_import/tests/test_base_import.py
AgeCommit message (Collapse)Author
2020-01-02[FIX] base_import: handling of scientific notationjerome hanke (jhk)
Steps to reproduce: -install sales -try to import a product file with volumes set to scientific notation (9.2e-05 for example) Previous behavior: scientific notation is not recognized by the base_import module and raises a small warning Current behavior: scientific notation is converted to decimal notation on the fly when possible opw-2162353 closes odoo/odoo#42591 X-original-commit: 9acd76c5d116abd07207af3b548658ad983ff82d Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-09-13[ADD] base_import: batching (& some other features)Xavier Morel
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
2018-07-17[IMP] import/export UIsJigar Patel
Task 40692 Various changes to import/export (mainly) UIs: * default to excel & "full" (non-import-compatible) export * auto-detect encoding of CSV using chardet * remember column -> field mapping after having imported a file (useful for repeated imports where auto-matching failed) * better handle localised booleans & column names * automatically select source list view's fields when exporting * better integrate import templates feature and add a number of templates
2018-04-12[FIX] base_import: activate advanced modeNicolas Martinelli
The commit 1ba4fbe640cf22abe did not match the specs of the task, but was merged anyway. Reverting the commit, and check by default so the user is not confused with missing fields. opw-1824074
2017-10-20[MERGE] forward port branch saas-16 up to dc2a6c6cd2aChristophe Simonis
2017-10-17[MERGE] forward port branch 10.0 up to cbca27d0052Christophe Simonis
2017-10-13[FIX] base_import: parse date and float for relational fieldsamoyaux
Use case to reproduce: -> Import a file with a float using a coma related to the model (for example the product.supplierinfo/price) It happens because the method that parse the date and float field only compare them to the main imported model. This commit complete the method by using a recursion on relational model in order to also parse the relational subfields.
2017-09-06[MERGE] forward port branch saas-16 up to 64d56995e04Christophe Simonis
2017-09-06[MERGE] forward port branch 10.0 up to a4bcb66bfc9Christophe Simonis
2017-09-05[FIX] base_import: headerless importNicolas Martinelli
- Import a CSV file without header - Untick the option 'The first row contains the label of the column' An error is reported. If no header, the method `_match_headers` should return consistent object types. opw-769117
2017-08-20[FIX] P3: import file content needs to be *bytes*Xavier Morel
2017-08-20[FIX] P3: CSV reading & writingXavier Morel
2017-08-20[FIX] P3: fix base64 and StringIO usesXavier Morel
* StringIO removed from stdlib, replace with io * try to correctly handle BytesIO/StringIO (one is for bytes the other is for text) * fix base64: Python 3 removed bytes-encoding and bytes-bytes codecs (via #encode) so replace all calls to str.encode('base64'), also b64encode is a bytes->bytes conversion so attempt to properly handle that issue #8530
2017-05-10[FIX] P3: list -> iterable builtins (#16811)xmo-odoo
In Python 3: * various builtins and dict methods were changed to return view/iterable objects rather than lists * and the separate Python 2 view/iterable builtins and methods were removed altogether This is problematic when using these items as list (which the happens repeatedly in Odoo), but more viciously when iterating *multiple times* over them (which also happens, which I've messed up multiple times while writing this, and which is a pain to debug even when you've just created the issue). Convert all code using these to semantics-matching cross-version helper functions to get the LCD behaviour between P2 and P3, and forbid the builtins via lint. issue #8530
2017-01-03[IMP] base_import: Improve import preview for related fieldsHaresh Shyara
normal mode: Importing only regular/basic fields from source file advanced mode: Importing any related fields from source file(i.e. if detected pattern in header like '<relational_fieldname>/<fname>') - Rename following checkbox "Show all fields for completion (advanced)" in "Show fields of relation fields (advanced)" - If the import file contains a column with a field of a relation field, show the column label in the preview, even if "Show fields of relation fields (advanced)" is not checked > to make it less confusing when importing advanced files (e.g. products with attributes) This is a backport of 1ba4fbe640cf, which was performed due to several tickets mentioning confusion with the new import system.
2016-12-07[IMP] fields: remove '_id(s)' from the labelMoises Lopez
For autogenerated labels. Use title instead of capitalize to get every word with a capital letter. Closes #12769
2016-11-10[IMP] base_import: Improve import preview for related fieldsHaresh Shyara
normal mode: Importing only regular/basic fields from source file advanced mode: Importing any related fields from source file(i.e. if detected pattern in header like '<relational_fieldname>/<fname>') - Rename following checkbox "Show all fields for completion (advanced)" in "Show fields of relation fields (advanced)" - If the import file contains a column with a field of a relation field, show the column label in the preview, even if "Show fields of relation fields (advanced)" is not checked > to make it less confusing when importing advanced files (e.g. products with attributes)
2016-10-14[FIX] base_import: allow to specify datetime format, fix encoding, add test ↵Jeremy Kersten
date, fix translation After this commit, - chinese custom date are supported - Possibility to specify the custom datetime format and not only dateformat. Withtout it, impossible to import a date column and datetime column at sametime with custom format. - Add test to check import date with custom format - Fix translation where error messages was in the source. This commit fixes #13783 and closes #13803 Courtesy of @odony for the review ;)
2016-09-02[FIX] adapt logger namesRaphael Collet
2016-08-31[REF] registry: now mapping model name to model classRaphael Collet
2016-07-07[MIG] base_import: migrate testsHitesh Trivedi
Some changes were required since in new API, fields label are not manage as before (defaulf value is field name, and not 'unknown' anymore).
2016-07-07[MIG] base_import : migrate to new apiHitesh Trivedi
2016-07-07[MOV] base_import: module directory organizationHitesh Trivedi
Note: move test models file in models to not import tests directory, which breaks the mute_logger of test cases