Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ exclude: |
(?x)
# NOT INSTALLABLE ADDONS
^base_export_async/|
^base_import_async/|
^test_base_import_async/|
# END NOT INSTALLABLE ADDONS
# Files and folders generated by bots, to avoid loops
Expand Down
17 changes: 13 additions & 4 deletions base_import_async/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,23 @@
{
"name": "Asynchronous Import",
"summary": "Import CSV files in the background",
"version": "14.0.1.0.1",
"version": "15.0.1.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"version": "15.0.1.0.1",
"version": "15.0.1.0.0",

Copy link
Contributor

@dzungtran89 dzungtran89 Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apart of this and @ChrisOForgeFlow's comment, lgtm

"author": "Akretion, ACSONE SA/NV, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/queue",
"category": "Generic Modules",
"depends": ["base_import", "queue_job"],
"data": ["data/queue_job_function_data.xml", "views/base_import_async.xml"],
"qweb": ["static/src/xml/import.xml"],
"installable": False,
"data": [
"data/queue_job_function_data.xml",
],
"assets": {
"web.assets_qweb": [
"base_import_async/static/src/xml/import.xml",
],
"web.assets_backend": [
"/base_import_async/static/src/js/import.js",
],
},
"installable": True,
"development_status": "Production/Stable",
}
80 changes: 80 additions & 0 deletions base_import_async/i18n/tr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_async
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0-20221029\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-24 07:21+0000\n"
"PO-Revision-Date: 2022-11-24 10:25+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: tr_TR\n"
"X-Generator: Poedit 2.4.2\n"

#. module: base_import_async
#: code:addons/base_import_async/models/queue_job.py:0
#, python-format
msgid "Attachment"
msgstr "Ek"

#. module: base_import_async
#: model:ir.model,name:base_import_async.model_base_import_import
msgid "Base Import"
msgstr "İçe aktarım"

#. module: base_import_async
#: code:addons/base_import_async/models/base_import_import.py:0
#, python-format
msgid "Import %s from file %s"
msgstr "%s dosyasından %s içe aktar"

#. module: base_import_async
#: code:addons/base_import_async/models/base_import_import.py:0
#, python-format
msgid "Import %s from file %s - #%s - lines %s to %s"
msgstr "%s dosyasından %s - #%s - %s - %s satırlarını içe aktar"

#. module: base_import_async
#. openerp-web
#: code:addons/base_import_async/static/src/xml/import.xml:0
#, python-format
msgid "Import in the background"
msgstr "Arka planda içe aktarım"

#. module: base_import_async
#: model:ir.model,name:base_import_async.model_queue_job
msgid "Queue Job"
msgstr "İş Kuyruğu"

#. module: base_import_async
#. openerp-web
#: code:addons/base_import_async/static/src/xml/import.xml:0
#, python-format
msgid ""
"When checked, the import will be executed as a background job, after "
"splitting your file in small chunks that will be processed independently. "
"Use this to import very large files."
msgstr ""
"İşaretlendiğinde, içe aktarım işlemi, dosyanızı bağımsız olarak işlenecek "
"küçük parçalara ayırdıktan sonra bir arka plan işi olarak yürütülür. Çok "
"büyük dosyaları içe aktarmak için bunu kullanın."

#. module: base_import_async
#. openerp-web
#: code:addons/base_import_async/static/src/js/import.js:0
#, python-format
msgid "You can check the status of this job in menu 'Queue / Jobs'."
msgstr "Bu işin durumunu 'Kuyruk / İşler' menüsünden kontrol edebilirsiniz."

#. module: base_import_async
#. openerp-web
#: code:addons/base_import_async/static/src/js/import.js:0
#, python-format
msgid "Your request is being processed"
msgstr "İsteğiniz işleniyor"
6 changes: 3 additions & 3 deletions base_import_async/models/base_import_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
class BaseImportImport(models.TransientModel):
_inherit = "base_import.import"

def do(self, fields, columns, options, dryrun=False):
def execute_import(self, fields, columns, options, dryrun=False):
if dryrun or not options.get(OPT_USE_QUEUE):
# normal import
return super().do(fields, columns, options, dryrun=dryrun)
return super().execute_import(fields, columns, options, dryrun=dryrun)

# asynchronous import
try:
Expand Down Expand Up @@ -130,7 +130,7 @@ def _split_file(
options,
file_name="file.csv",
):
""" Split a CSV attachment in smaller import jobs """
"""Split a CSV attachment in smaller import jobs"""
model_obj = self.env[model_name]
fields, data = self._read_csv_attachment(attachment, options)
padding = len(str(len(data)))
Expand Down
2 changes: 1 addition & 1 deletion base_import_async/models/queue_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class QueueJob(models.Model):
""" Job status and result """
"""Job status and result"""

_inherit = "queue.job"

Expand Down
2 changes: 1 addition & 1 deletion base_import_async/static/src/xml/import.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<templates>
<t t-extend="ImportView">
<t t-extend="ImportView.side_panel">
<t t-jquery="#oe_import_has_header" t-operation="before">
<div
title="When checked, the import will be executed as a background job,
Expand Down
15 changes: 0 additions & 15 deletions base_import_async/views/base_import_async.xml

This file was deleted.

6 changes: 6 additions & 0 deletions setup/base_import_async/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)