odoo-addon-base-import-async 17.0.1.0.0.2__py3-none-any.whl → 18.0.1.0.0.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/base_import_async/README.rst +8 -7
- odoo/addons/base_import_async/__manifest__.py +1 -1
- odoo/addons/base_import_async/i18n/base_import_async.pot +1 -8
- odoo/addons/base_import_async/i18n/nl.po +80 -0
- odoo/addons/base_import_async/models/base_import_import.py +3 -2
- odoo/addons/base_import_async/readme/CONTRIBUTORS.md +2 -1
- odoo/addons/base_import_async/readme/CREDITS.md +1 -1
- odoo/addons/base_import_async/static/description/index.html +6 -5
- odoo/addons/base_import_async/static/src/js/import_model.esm.js +4 -4
- odoo/addons/base_import_async/static/src/xml/import_data_sidepanel.xml +2 -1
- odoo/addons/base_import_async/tests/__init__.py +1 -0
- odoo/addons/base_import_async/tests/test_base_import_import.py +99 -0
- {odoo_addon_base_import_async-17.0.1.0.0.2.dist-info → odoo_addon_base_import_async-18.0.1.0.0.6.dist-info}/METADATA +13 -11
- {odoo_addon_base_import_async-17.0.1.0.0.2.dist-info → odoo_addon_base_import_async-18.0.1.0.0.6.dist-info}/RECORD +16 -13
- {odoo_addon_base_import_async-17.0.1.0.0.2.dist-info → odoo_addon_base_import_async-18.0.1.0.0.6.dist-info}/WHEEL +1 -1
- {odoo_addon_base_import_async-17.0.1.0.0.2.dist-info → odoo_addon_base_import_async-18.0.1.0.0.6.dist-info}/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ Asynchronous Import
|
|
|
7
7
|
!! This file is generated by oca-gen-addon-readme !!
|
|
8
8
|
!! changes will be overwritten. !!
|
|
9
9
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
10
|
-
!! source digest: sha256:
|
|
10
|
+
!! source digest: sha256:299c64b165f6348dfa062b8925a95235390daa6063964f21a5a1d0757cdf1614
|
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
|
|
@@ -17,13 +17,13 @@ Asynchronous Import
|
|
|
17
17
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
18
18
|
:alt: License: AGPL-3
|
|
19
19
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github
|
|
20
|
-
:target: https://github.com/OCA/queue/tree/
|
|
20
|
+
:target: https://github.com/OCA/queue/tree/18.0/base_import_async
|
|
21
21
|
:alt: OCA/queue
|
|
22
22
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
23
|
-
:target: https://translation.odoo-community.org/projects/queue-
|
|
23
|
+
:target: https://translation.odoo-community.org/projects/queue-18-0/queue-18-0-base_import_async
|
|
24
24
|
:alt: Translate me on Weblate
|
|
25
25
|
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
26
|
-
:target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=
|
|
26
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=18.0
|
|
27
27
|
:alt: Try me on Runboat
|
|
28
28
|
|
|
29
29
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
@@ -87,7 +87,7 @@ Bug Tracker
|
|
|
87
87
|
Bugs are tracked on `GitHub Issues <https://github.com/OCA/queue/issues>`_.
|
|
88
88
|
In case of trouble, please check there if your issue has already been reported.
|
|
89
89
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
90
|
-
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20base_import_async%0Aversion:%
|
|
90
|
+
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20base_import_async%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
91
91
|
|
|
92
92
|
Do not contact contributors directly about support or help with technical issues.
|
|
93
93
|
|
|
@@ -126,13 +126,14 @@ Other contributors include:
|
|
|
126
126
|
- `Trobz <https://trobz.com>`__:
|
|
127
127
|
|
|
128
128
|
- Dzung Tran <dungtd@trobz.com>
|
|
129
|
+
- Do Anh Duy <duyda@trobz.com>
|
|
129
130
|
|
|
130
131
|
- Daniel Duque (FactorLibre)
|
|
131
132
|
|
|
132
133
|
Other credits
|
|
133
134
|
-------------
|
|
134
135
|
|
|
135
|
-
The migration of this module from
|
|
136
|
+
The migration of this module from 17.0 to 18.0 was financially supported
|
|
136
137
|
by Camptocamp
|
|
137
138
|
|
|
138
139
|
Maintainers
|
|
@@ -148,6 +149,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
|
148
149
|
mission is to support the collaborative development of Odoo features and
|
|
149
150
|
promote its widespread use.
|
|
150
151
|
|
|
151
|
-
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/
|
|
152
|
+
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/18.0/base_import_async>`_ project on GitHub.
|
|
152
153
|
|
|
153
154
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
{
|
|
6
6
|
"name": "Asynchronous Import",
|
|
7
7
|
"summary": "Import CSV files in the background",
|
|
8
|
-
"version": "
|
|
8
|
+
"version": "18.0.1.0.0",
|
|
9
9
|
"author": "Akretion, ACSONE SA/NV, Odoo Community Association (OCA)",
|
|
10
10
|
"license": "AGPL-3",
|
|
11
11
|
"website": "https://github.com/OCA/queue",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#
|
|
5
5
|
msgid ""
|
|
6
6
|
msgstr ""
|
|
7
|
-
"Project-Id-Version: Odoo Server
|
|
7
|
+
"Project-Id-Version: Odoo Server 18.0\n"
|
|
8
8
|
"Report-Msgid-Bugs-To: \n"
|
|
9
9
|
"Last-Translator: \n"
|
|
10
10
|
"Language-Team: \n"
|
|
@@ -16,7 +16,6 @@ msgstr ""
|
|
|
16
16
|
#. module: base_import_async
|
|
17
17
|
#. odoo-python
|
|
18
18
|
#: code:addons/base_import_async/models/queue_job.py:0
|
|
19
|
-
#, python-format
|
|
20
19
|
msgid "Attachment"
|
|
21
20
|
msgstr ""
|
|
22
21
|
|
|
@@ -28,7 +27,6 @@ msgstr ""
|
|
|
28
27
|
#. module: base_import_async
|
|
29
28
|
#. odoo-python
|
|
30
29
|
#: code:addons/base_import_async/models/base_import_import.py:0
|
|
31
|
-
#, python-format
|
|
32
30
|
msgid ""
|
|
33
31
|
"Import %(model)s from file %(file_name)s - #%(chunk)s - lines %(from)s to "
|
|
34
32
|
"%(to)s"
|
|
@@ -37,14 +35,12 @@ msgstr ""
|
|
|
37
35
|
#. module: base_import_async
|
|
38
36
|
#. odoo-python
|
|
39
37
|
#: code:addons/base_import_async/models/base_import_import.py:0
|
|
40
|
-
#, python-format
|
|
41
38
|
msgid "Import %(model)s from file %(from_file)s"
|
|
42
39
|
msgstr ""
|
|
43
40
|
|
|
44
41
|
#. module: base_import_async
|
|
45
42
|
#. odoo-javascript
|
|
46
43
|
#: code:addons/base_import_async/static/src/xml/import_data_sidepanel.xml:0
|
|
47
|
-
#, python-format
|
|
48
44
|
msgid "Import in the background"
|
|
49
45
|
msgstr ""
|
|
50
46
|
|
|
@@ -56,7 +52,6 @@ msgstr ""
|
|
|
56
52
|
#. module: base_import_async
|
|
57
53
|
#. odoo-javascript
|
|
58
54
|
#: code:addons/base_import_async/static/src/xml/import_data_sidepanel.xml:0
|
|
59
|
-
#, python-format
|
|
60
55
|
msgid ""
|
|
61
56
|
"When checked, the import will be executed as a background job, after "
|
|
62
57
|
"splitting your file in small chunks that will be processed independently. "
|
|
@@ -66,13 +61,11 @@ msgstr ""
|
|
|
66
61
|
#. module: base_import_async
|
|
67
62
|
#. odoo-javascript
|
|
68
63
|
#: code:addons/base_import_async/static/src/js/import_model.esm.js:0
|
|
69
|
-
#, python-format
|
|
70
64
|
msgid "You can check the status of this job in menu 'Queue / Jobs'."
|
|
71
65
|
msgstr ""
|
|
72
66
|
|
|
73
67
|
#. module: base_import_async
|
|
74
68
|
#. odoo-javascript
|
|
75
69
|
#: code:addons/base_import_async/static/src/js/import_model.esm.js:0
|
|
76
|
-
#, python-format
|
|
77
70
|
msgid "Your request is being processed"
|
|
78
71
|
msgstr ""
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Translation of Odoo Server.
|
|
2
|
+
# This file contains the translation of the following modules:
|
|
3
|
+
# * base_import_async
|
|
4
|
+
#
|
|
5
|
+
msgid ""
|
|
6
|
+
msgstr ""
|
|
7
|
+
"Project-Id-Version: Odoo Server 18.0\n"
|
|
8
|
+
"Report-Msgid-Bugs-To: \n"
|
|
9
|
+
"PO-Revision-Date: 2025-08-15 13:18+0000\n"
|
|
10
|
+
"Last-Translator: Bosd <c5e2fd43-d292-4c90-9d1f-74ff3436329a@anonaddy.me>\n"
|
|
11
|
+
"Language-Team: none\n"
|
|
12
|
+
"Language: nl\n"
|
|
13
|
+
"MIME-Version: 1.0\n"
|
|
14
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
15
|
+
"Content-Transfer-Encoding: \n"
|
|
16
|
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
|
17
|
+
"X-Generator: Weblate 5.10.4\n"
|
|
18
|
+
|
|
19
|
+
#. module: base_import_async
|
|
20
|
+
#. odoo-python
|
|
21
|
+
#: code:addons/base_import_async/models/queue_job.py:0
|
|
22
|
+
msgid "Attachment"
|
|
23
|
+
msgstr "Bijlage"
|
|
24
|
+
|
|
25
|
+
#. module: base_import_async
|
|
26
|
+
#: model:ir.model,name:base_import_async.model_base_import_import
|
|
27
|
+
msgid "Base Import"
|
|
28
|
+
msgstr "Basis import"
|
|
29
|
+
|
|
30
|
+
#. module: base_import_async
|
|
31
|
+
#. odoo-python
|
|
32
|
+
#: code:addons/base_import_async/models/base_import_import.py:0
|
|
33
|
+
msgid ""
|
|
34
|
+
"Import %(model)s from file %(file_name)s - #%(chunk)s - lines %(from)s to "
|
|
35
|
+
"%(to)s"
|
|
36
|
+
msgstr ""
|
|
37
|
+
"Importeer %(model)s vanuit bestand %(file_name)s - #%(chunk)s - regels "
|
|
38
|
+
"%(from)s tot %(to)s"
|
|
39
|
+
|
|
40
|
+
#. module: base_import_async
|
|
41
|
+
#. odoo-python
|
|
42
|
+
#: code:addons/base_import_async/models/base_import_import.py:0
|
|
43
|
+
msgid "Import %(model)s from file %(from_file)s"
|
|
44
|
+
msgstr "Importeer %(model)s vanuit bestand %(from_file)s"
|
|
45
|
+
|
|
46
|
+
#. module: base_import_async
|
|
47
|
+
#. odoo-javascript
|
|
48
|
+
#: code:addons/base_import_async/static/src/xml/import_data_sidepanel.xml:0
|
|
49
|
+
msgid "Import in the background"
|
|
50
|
+
msgstr "Importeer op de achtergrond"
|
|
51
|
+
|
|
52
|
+
#. module: base_import_async
|
|
53
|
+
#: model:ir.model,name:base_import_async.model_queue_job
|
|
54
|
+
msgid "Queue Job"
|
|
55
|
+
msgstr "Wachtrijtaak"
|
|
56
|
+
|
|
57
|
+
#. module: base_import_async
|
|
58
|
+
#. odoo-javascript
|
|
59
|
+
#: code:addons/base_import_async/static/src/xml/import_data_sidepanel.xml:0
|
|
60
|
+
msgid ""
|
|
61
|
+
"When checked, the import will be executed as a background job, after "
|
|
62
|
+
"splitting your file in small chunks that will be processed independently. "
|
|
63
|
+
"Use this to import very large files."
|
|
64
|
+
msgstr ""
|
|
65
|
+
"Indien aangevinkt, wordt de import uitgevoerd als een achtergrondtaak, nadat "
|
|
66
|
+
"uw bestand is opgesplitst in kleine delen die onafhankelijk van elkaar "
|
|
67
|
+
"worden verwerkt. Gebruik dit voor het importeren van zeer grote bestanden."
|
|
68
|
+
|
|
69
|
+
#. module: base_import_async
|
|
70
|
+
#. odoo-javascript
|
|
71
|
+
#: code:addons/base_import_async/static/src/js/import_model.esm.js:0
|
|
72
|
+
msgid "You can check the status of this job in menu 'Queue / Jobs'."
|
|
73
|
+
msgstr ""
|
|
74
|
+
"U kunt de status van deze taak controleren in het menu 'Wachtrij / Taken'."
|
|
75
|
+
|
|
76
|
+
#. module: base_import_async
|
|
77
|
+
#. odoo-javascript
|
|
78
|
+
#: code:addons/base_import_async/static/src/js/import_model.esm.js:0
|
|
79
|
+
msgid "Your request is being processed"
|
|
80
|
+
msgstr "Uw verzoek wordt verwerkt"
|
|
@@ -12,6 +12,7 @@ from os.path import splitext
|
|
|
12
12
|
from odoo import _, api, models
|
|
13
13
|
from odoo.models import fix_import_export_id_paths
|
|
14
14
|
|
|
15
|
+
from odoo.addons.base_import.models.base_import import ImportValidationError
|
|
15
16
|
from odoo.addons.queue_job.exception import FailedJobError
|
|
16
17
|
|
|
17
18
|
# options defined in base_import/import.js
|
|
@@ -42,8 +43,8 @@ class BaseImportImport(models.TransientModel):
|
|
|
42
43
|
data, import_fields = self._convert_import_data(fields, options)
|
|
43
44
|
# Parse date and float field
|
|
44
45
|
data = self._parse_import_data(data, import_fields, options)
|
|
45
|
-
except ValueError as e:
|
|
46
|
-
return {"messages": [
|
|
46
|
+
except (ImportValidationError, ValueError) as e:
|
|
47
|
+
return {"messages": [e.__dict__]}
|
|
47
48
|
|
|
48
49
|
# get the translated model name to build
|
|
49
50
|
# a meaningful job description
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
The migration of this module from
|
|
1
|
+
The migration of this module from 17.0 to 18.0 was financially supported
|
|
2
2
|
by Camptocamp
|
|
@@ -367,9 +367,9 @@ ul.auto-toc {
|
|
|
367
367
|
!! This file is generated by oca-gen-addon-readme !!
|
|
368
368
|
!! changes will be overwritten. !!
|
|
369
369
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
370
|
-
!! source digest: sha256:
|
|
370
|
+
!! source digest: sha256:299c64b165f6348dfa062b8925a95235390daa6063964f21a5a1d0757cdf1614
|
|
371
371
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
372
|
-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/queue/tree/
|
|
372
|
+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/queue/tree/18.0/base_import_async"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/queue-18-0/queue-18-0-base_import_async"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
373
373
|
<p>This module extends the standard CSV import functionality to import
|
|
374
374
|
files in the background using the OCA/queue framework.</p>
|
|
375
375
|
<p><strong>Table of contents</strong></p>
|
|
@@ -438,7 +438,7 @@ easy to add an option to extend the import screen.</li>
|
|
|
438
438
|
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/queue/issues">GitHub Issues</a>.
|
|
439
439
|
In case of trouble, please check there if your issue has already been reported.
|
|
440
440
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
441
|
-
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20base_import_async%0Aversion:%
|
|
441
|
+
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20base_import_async%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
|
442
442
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
|
443
443
|
</div>
|
|
444
444
|
<div class="section" id="credits">
|
|
@@ -466,6 +466,7 @@ control the asynchronous behaviour.</p>
|
|
|
466
466
|
<li>Guewen Baconnier (Camptocamp)</li>
|
|
467
467
|
<li><a class="reference external" href="https://trobz.com">Trobz</a>:<ul>
|
|
468
468
|
<li>Dzung Tran <<a class="reference external" href="mailto:dungtd@trobz.com">dungtd@trobz.com</a>></li>
|
|
469
|
+
<li>Do Anh Duy <<a class="reference external" href="mailto:duyda@trobz.com">duyda@trobz.com</a>></li>
|
|
469
470
|
</ul>
|
|
470
471
|
</li>
|
|
471
472
|
<li>Daniel Duque (FactorLibre)</li>
|
|
@@ -473,7 +474,7 @@ control the asynchronous behaviour.</p>
|
|
|
473
474
|
</div>
|
|
474
475
|
<div class="section" id="other-credits">
|
|
475
476
|
<h2><a class="toc-backref" href="#toc-entry-9">Other credits</a></h2>
|
|
476
|
-
<p>The migration of this module from
|
|
477
|
+
<p>The migration of this module from 17.0 to 18.0 was financially supported
|
|
477
478
|
by Camptocamp</p>
|
|
478
479
|
</div>
|
|
479
480
|
<div class="section" id="maintainers">
|
|
@@ -485,7 +486,7 @@ by Camptocamp</p>
|
|
|
485
486
|
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
486
487
|
mission is to support the collaborative development of Odoo features and
|
|
487
488
|
promote its widespread use.</p>
|
|
488
|
-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/
|
|
489
|
+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/18.0/base_import_async">OCA/queue</a> project on GitHub.</p>
|
|
489
490
|
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
|
490
491
|
</div>
|
|
491
492
|
</div>
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/** @odoo-module **/
|
|
2
|
-
|
|
3
1
|
import {BaseImportModel} from "@base_import/import_model";
|
|
4
2
|
import {_t} from "@web/core/l10n/translation";
|
|
5
3
|
import {patch} from "@web/core/utils/patch";
|
|
6
4
|
|
|
5
|
+
const {document} = globalThis;
|
|
6
|
+
|
|
7
7
|
patch(BaseImportModel.prototype, {
|
|
8
8
|
get importOptions() {
|
|
9
9
|
const options = super.importOptions;
|
|
10
|
-
const checkbox = document.querySelector("
|
|
10
|
+
const checkbox = document.querySelector("#oe_import_queue");
|
|
11
11
|
options.use_queue = checkbox ? checkbox.checked : false;
|
|
12
12
|
return options;
|
|
13
13
|
},
|
|
14
14
|
|
|
15
15
|
async executeImport(isTest, totalSteps, importProgress) {
|
|
16
16
|
const def = super.executeImport(isTest, totalSteps, importProgress);
|
|
17
|
-
const checkbox = document.querySelector("
|
|
17
|
+
const checkbox = document.querySelector("#oe_import_queue");
|
|
18
18
|
if (checkbox && checkbox.checked && !isTest) {
|
|
19
19
|
this._addMessage("warning", [
|
|
20
20
|
_t("Your request is being processed"),
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
<templates xml:space="preserve">
|
|
3
3
|
<t
|
|
4
4
|
t-name="base_import_async.ImportDataSidepanel"
|
|
5
|
-
t-inherit="
|
|
5
|
+
t-inherit="ImportDataSidepanel"
|
|
6
6
|
t-inherit-mode="extension"
|
|
7
7
|
>
|
|
8
8
|
<xpath expr="//CheckBox" position="before">
|
|
9
9
|
<div
|
|
10
|
+
class="o-checkbox form-check"
|
|
10
11
|
title="When checked, the import will be executed as a background job,
|
|
11
12
|
after splitting your file in small chunks that will be processed independently.
|
|
12
13
|
Use this to import very large files."
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import test_base_import_import
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Copyright 2024 Camptocamp
|
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
3
|
+
|
|
4
|
+
from odoo.tests.common import RecordCapturer, TransactionCase
|
|
5
|
+
|
|
6
|
+
from ..models.base_import_import import OPT_USE_QUEUE
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TestBaseImportImport(TransactionCase):
|
|
10
|
+
@classmethod
|
|
11
|
+
def setUpClass(cls):
|
|
12
|
+
super().setUpClass()
|
|
13
|
+
cls.res_partners = cls.env["res.partner"]
|
|
14
|
+
cls.import_wizard = cls.env["base_import.import"]
|
|
15
|
+
|
|
16
|
+
def test_normal_import_res_partners(self):
|
|
17
|
+
values = [
|
|
18
|
+
[
|
|
19
|
+
"name",
|
|
20
|
+
"email",
|
|
21
|
+
"is_company",
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"partner 1",
|
|
25
|
+
"partner1@example.com",
|
|
26
|
+
"1",
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"partner 2",
|
|
30
|
+
"partner2@example.com",
|
|
31
|
+
"0",
|
|
32
|
+
],
|
|
33
|
+
]
|
|
34
|
+
import_vals = {
|
|
35
|
+
"res_model": self.res_partners._name,
|
|
36
|
+
"file": "\n".join([";".join(values) for values in values]),
|
|
37
|
+
"file_type": "text/csv",
|
|
38
|
+
}
|
|
39
|
+
self.import_wizard |= self.import_wizard.create(import_vals)
|
|
40
|
+
opts = {"quoting": '"', "separator": ";", "has_headers": True}
|
|
41
|
+
preview = self.import_wizard.parse_preview(opts)
|
|
42
|
+
self.assertEqual(
|
|
43
|
+
preview["matches"],
|
|
44
|
+
{
|
|
45
|
+
0: ["name"],
|
|
46
|
+
1: ["email"],
|
|
47
|
+
2: ["is_company"],
|
|
48
|
+
},
|
|
49
|
+
)
|
|
50
|
+
with RecordCapturer(self.res_partners, []) as capture:
|
|
51
|
+
results = self.import_wizard.execute_import(
|
|
52
|
+
[fnames[0] for fnames in preview["matches"].values()],
|
|
53
|
+
[],
|
|
54
|
+
opts,
|
|
55
|
+
)
|
|
56
|
+
# if result is empty, no import error
|
|
57
|
+
self.assertItemsEqual(results["messages"], [])
|
|
58
|
+
records_created = capture.records
|
|
59
|
+
self.assertEqual(len(records_created), 2)
|
|
60
|
+
self.assertIn("partner1", records_created[0].email)
|
|
61
|
+
|
|
62
|
+
def test_wrong_import_res_partners(self):
|
|
63
|
+
values = [
|
|
64
|
+
[
|
|
65
|
+
"name",
|
|
66
|
+
"email",
|
|
67
|
+
"date", # Adding date field to trigger parsing error
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
"partner 1",
|
|
71
|
+
"partner1@example.com",
|
|
72
|
+
"21-13-2024",
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
"partner 2",
|
|
76
|
+
"partner2@example.com",
|
|
77
|
+
"2024-13-45",
|
|
78
|
+
],
|
|
79
|
+
]
|
|
80
|
+
opts = {
|
|
81
|
+
"quoting": '"',
|
|
82
|
+
"separator": ";",
|
|
83
|
+
"has_headers": True,
|
|
84
|
+
"date_format": "%Y-%m-%d", # Set specific date format
|
|
85
|
+
OPT_USE_QUEUE: True,
|
|
86
|
+
}
|
|
87
|
+
import_vals = {
|
|
88
|
+
"res_model": self.res_partners._name,
|
|
89
|
+
"file": "\n".join([";".join(row) for row in values]),
|
|
90
|
+
"file_type": "text/csv",
|
|
91
|
+
}
|
|
92
|
+
import_wizard = self.import_wizard.create(import_vals)
|
|
93
|
+
preview = import_wizard.parse_preview(opts)
|
|
94
|
+
results = import_wizard.execute_import(
|
|
95
|
+
[field[0] for field in preview["matches"].values()],
|
|
96
|
+
["name", "email", "date"], # Include date in fields to import
|
|
97
|
+
opts,
|
|
98
|
+
)
|
|
99
|
+
self.assertTrue(any(msg["type"] == "error" for msg in results["messages"]))
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: odoo-addon-base_import_async
|
|
3
|
-
Version:
|
|
3
|
+
Version: 18.0.1.0.0.6
|
|
4
4
|
Requires-Python: >=3.10
|
|
5
|
-
Requires-Dist: odoo-addon-queue_job
|
|
6
|
-
Requires-Dist: odoo
|
|
5
|
+
Requires-Dist: odoo-addon-queue_job==18.0.*
|
|
6
|
+
Requires-Dist: odoo==18.0.*
|
|
7
7
|
Summary: Import CSV files in the background
|
|
8
8
|
Home-page: https://github.com/OCA/queue
|
|
9
9
|
License: AGPL-3
|
|
@@ -11,9 +11,10 @@ Author: Akretion, ACSONE SA/NV, Odoo Community Association (OCA)
|
|
|
11
11
|
Author-email: support@odoo-community.org
|
|
12
12
|
Classifier: Programming Language :: Python
|
|
13
13
|
Classifier: Framework :: Odoo
|
|
14
|
-
Classifier: Framework :: Odoo ::
|
|
14
|
+
Classifier: Framework :: Odoo :: 18.0
|
|
15
15
|
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
16
16
|
Classifier: Development Status :: 5 - Production/Stable
|
|
17
|
+
Description-Content-Type: text/x-rst
|
|
17
18
|
|
|
18
19
|
===================
|
|
19
20
|
Asynchronous Import
|
|
@@ -24,7 +25,7 @@ Asynchronous Import
|
|
|
24
25
|
!! This file is generated by oca-gen-addon-readme !!
|
|
25
26
|
!! changes will be overwritten. !!
|
|
26
27
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
27
|
-
!! source digest: sha256:
|
|
28
|
+
!! source digest: sha256:299c64b165f6348dfa062b8925a95235390daa6063964f21a5a1d0757cdf1614
|
|
28
29
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
29
30
|
|
|
30
31
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
|
|
@@ -34,13 +35,13 @@ Asynchronous Import
|
|
|
34
35
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
35
36
|
:alt: License: AGPL-3
|
|
36
37
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github
|
|
37
|
-
:target: https://github.com/OCA/queue/tree/
|
|
38
|
+
:target: https://github.com/OCA/queue/tree/18.0/base_import_async
|
|
38
39
|
:alt: OCA/queue
|
|
39
40
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
40
|
-
:target: https://translation.odoo-community.org/projects/queue-
|
|
41
|
+
:target: https://translation.odoo-community.org/projects/queue-18-0/queue-18-0-base_import_async
|
|
41
42
|
:alt: Translate me on Weblate
|
|
42
43
|
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
43
|
-
:target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=
|
|
44
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=18.0
|
|
44
45
|
:alt: Try me on Runboat
|
|
45
46
|
|
|
46
47
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
@@ -104,7 +105,7 @@ Bug Tracker
|
|
|
104
105
|
Bugs are tracked on `GitHub Issues <https://github.com/OCA/queue/issues>`_.
|
|
105
106
|
In case of trouble, please check there if your issue has already been reported.
|
|
106
107
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
107
|
-
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20base_import_async%0Aversion:%
|
|
108
|
+
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20base_import_async%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
108
109
|
|
|
109
110
|
Do not contact contributors directly about support or help with technical issues.
|
|
110
111
|
|
|
@@ -143,13 +144,14 @@ Other contributors include:
|
|
|
143
144
|
- `Trobz <https://trobz.com>`__:
|
|
144
145
|
|
|
145
146
|
- Dzung Tran <dungtd@trobz.com>
|
|
147
|
+
- Do Anh Duy <duyda@trobz.com>
|
|
146
148
|
|
|
147
149
|
- Daniel Duque (FactorLibre)
|
|
148
150
|
|
|
149
151
|
Other credits
|
|
150
152
|
-------------
|
|
151
153
|
|
|
152
|
-
The migration of this module from
|
|
154
|
+
The migration of this module from 17.0 to 18.0 was financially supported
|
|
153
155
|
by Camptocamp
|
|
154
156
|
|
|
155
157
|
Maintainers
|
|
@@ -165,6 +167,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
|
165
167
|
mission is to support the collaborative development of Odoo features and
|
|
166
168
|
promote its widespread use.
|
|
167
169
|
|
|
168
|
-
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/
|
|
170
|
+
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/18.0/base_import_async>`_ project on GitHub.
|
|
169
171
|
|
|
170
172
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
odoo/addons/base_import_async/README.rst,sha256=
|
|
1
|
+
odoo/addons/base_import_async/README.rst,sha256=bC5FIxnKWgpy0DNUUVwUe-T_QnvNGNCaUsT1ocacjEo,5077
|
|
2
2
|
odoo/addons/base_import_async/__init__.py,sha256=eShEGRadAlxopoLqIQ4-N42FM7MWPSuBe0h_l1cXTPM,87
|
|
3
|
-
odoo/addons/base_import_async/__manifest__.py,sha256=
|
|
3
|
+
odoo/addons/base_import_async/__manifest__.py,sha256=SsVjSsfL53MwNZnVLy7BHbSh84eFi_jNkCgc_YD7SIA,868
|
|
4
4
|
odoo/addons/base_import_async/data/queue_job_function_data.xml,sha256=MhA59cNIFz0tybIEYYfas5vIgAL7YVje26-n0EKnwVE,763
|
|
5
|
-
odoo/addons/base_import_async/i18n/base_import_async.pot,sha256=
|
|
5
|
+
odoo/addons/base_import_async/i18n/base_import_async.pot,sha256=aL1yvEPyrIqSFRMQMS-RgyQk8hrfe9dh2pvgvasX7zc,1981
|
|
6
6
|
odoo/addons/base_import_async/i18n/es.po,sha256=4pquZPN4cwoNJULxAPDDNgOO4bagakEJw7QRyU-QHHM,2774
|
|
7
7
|
odoo/addons/base_import_async/i18n/it.po,sha256=4WklbHLMT1sb8MfShTBaQQTP4Ruz1HpVi1PfTrbXuUc,2736
|
|
8
|
+
odoo/addons/base_import_async/i18n/nl.po,sha256=umxg-tzH_0LH7nWm1CVybcBeYYuV0qDao1XXwm4COo8,2694
|
|
8
9
|
odoo/addons/base_import_async/i18n/tr.po,sha256=kKC4SZ-I034SLjmSIpCkLyUFpaiflEw_7_cCEDCBe9Y,2854
|
|
9
10
|
odoo/addons/base_import_async/models/__init__.py,sha256=O_Ai1JLN-RrWSSWZmCSu_fZ4kq-2nJiBEWOjerAN6Qo,123
|
|
10
|
-
odoo/addons/base_import_async/models/base_import_import.py,sha256=
|
|
11
|
+
odoo/addons/base_import_async/models/base_import_import.py,sha256=ZiNpKEGsFhPzYeFfw27joycWqul1PfVsKwrhzGuehQw,7331
|
|
11
12
|
odoo/addons/base_import_async/models/queue_job.py,sha256=8T8oe8hF8LK8Dq8T8PxLxHDtMLH4rTQuAcC6Qz0X6r4,491
|
|
12
|
-
odoo/addons/base_import_async/readme/CONTRIBUTORS.md,sha256=
|
|
13
|
-
odoo/addons/base_import_async/readme/CREDITS.md,sha256=
|
|
13
|
+
odoo/addons/base_import_async/readme/CONTRIBUTORS.md,sha256=5qZjXXtS2bsEFx34uavcE9ZPJxD6WtgRYIACA8KlOek,568
|
|
14
|
+
odoo/addons/base_import_async/readme/CREDITS.md,sha256=JioPiNwd9zjoni_RFagda7cUI1Weu2O5mEvZ2ah8ROQ,87
|
|
14
15
|
odoo/addons/base_import_async/readme/DESCRIPTION.md,sha256=fm7FO_7wKtmir7kAqTJRTGvUTMDbe9zJkBP_z0bLpHM,123
|
|
15
16
|
odoo/addons/base_import_async/readme/HISTORY.md,sha256=24qB1TG1LDqfu9TT1j1gDhgiDDEbV6_5WNvQvYGlVoI,79
|
|
16
17
|
odoo/addons/base_import_async/readme/ROADMAP.md,sha256=cnTSBGOUAv-eGJLOGCMgL6lssfMNLagjKO_sBY2een4,243
|
|
17
18
|
odoo/addons/base_import_async/readme/USAGE.md,sha256=MRQCFtztLlD1vktg_aeTMw32MBRrkSek3KnDRCSgi0k,1150
|
|
18
19
|
odoo/addons/base_import_async/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
|
|
19
|
-
odoo/addons/base_import_async/static/description/index.html,sha256=
|
|
20
|
-
odoo/addons/base_import_async/static/src/js/import_model.esm.js,sha256=
|
|
21
|
-
odoo/addons/base_import_async/static/src/xml/import_data_sidepanel.xml,sha256=
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
odoo_addon_base_import_async-
|
|
25
|
-
odoo_addon_base_import_async-
|
|
20
|
+
odoo/addons/base_import_async/static/description/index.html,sha256=B7xlyuD6QZNu4wYSwxiKHcDiBnf7BOML2Un3rdM1kns,15652
|
|
21
|
+
odoo/addons/base_import_async/static/src/js/import_model.esm.js,sha256=7WqYaRt8Sz029SVO4Xy4l4_dht8NAqS_du2YqcutfpY,957
|
|
22
|
+
odoo/addons/base_import_async/static/src/xml/import_data_sidepanel.xml,sha256=mbCtHcDVShvbY5jN1RAmXhRkiZJP57N3Kig9AlPqjfY,865
|
|
23
|
+
odoo/addons/base_import_async/tests/__init__.py,sha256=zlJqLs-_34OrP2pEd6UIlGnkyqxVgRA6Xm7j30xu5F8,38
|
|
24
|
+
odoo/addons/base_import_async/tests/test_base_import_import.py,sha256=z9Sm1eI_a6pWS6zxc7TKvMUgjvCUn5yVe5ozT38jJ84,3245
|
|
25
|
+
odoo_addon_base_import_async-18.0.1.0.0.6.dist-info/METADATA,sha256=dfhT4v3MUKoTNyM3XStohgDYAjDE1XbobCFwzc_itKE,5739
|
|
26
|
+
odoo_addon_base_import_async-18.0.1.0.0.6.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
|
|
27
|
+
odoo_addon_base_import_async-18.0.1.0.0.6.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
|
|
28
|
+
odoo_addon_base_import_async-18.0.1.0.0.6.dist-info/RECORD,,
|