summaryrefslogtreecommitdiff
path: root/addons/base_import/models/base_import.py
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2019-07-10 14:59:37 +0200
committerAdrian Torres <adt@odoo.com>2019-07-17 14:13:12 +0200
commit4b38cc6590abcb58a0ca102a06063eb3db7ac1f4 (patch)
treecfd11739fc6b4c0cb4b23b54cc6badad4bf5c55e /addons/base_import/models/base_import.py
parentf6fdde96bddfedf8764cd8a73089e44340d476ae (diff)
[REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly decorate methods with it, adds clutter and most people use it because they see that the rest of the code uses it. Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
Diffstat (limited to 'addons/base_import/models/base_import.py')
-rw-r--r--addons/base_import/models/base_import.py8
1 files changed, 0 insertions, 8 deletions
diff --git a/addons/base_import/models/base_import.py b/addons/base_import/models/base_import.py
index 8626d76acb9..76ad4683e28 100644
--- a/addons/base_import/models/base_import.py
+++ b/addons/base_import/models/base_import.py
@@ -223,7 +223,6 @@ class Import(models.TransientModel):
# TODO: cache on model?
return importable_fields
- @api.multi
def _read_file(self, options):
""" Dispatch to specific method to read file content, according to its mimetype or file type
:param options : dict of reading options (quoting, separator, ...)
@@ -261,7 +260,6 @@ class Import(models.TransientModel):
raise ImportError(_("Unable to load \"{extension}\" file: requires Python module \"{modname}\"").format(extension=file_extension, modname=req))
raise ValueError(_("Unsupported file format \"{}\", import only supports CSV, ODS, XLS and XLSX").format(self.file_type))
- @api.multi
def _read_xls(self, options):
""" Read file content, using xlrd lib """
book = xlrd.open_workbook(file_contents=self.file or b'')
@@ -307,7 +305,6 @@ class Import(models.TransientModel):
# use the same method for xlsx and xls files
_read_xlsx = _read_xls
- @api.multi
def _read_ods(self, options):
""" Read file content using ODSReader custom lib """
doc = odf_ods_reader.ODSReader(file=io.BytesIO(self.file or b''))
@@ -318,7 +315,6 @@ class Import(models.TransientModel):
if any(x for x in row if x.strip())
)
- @api.multi
def _read_csv(self, options):
""" Returns a CSV-parsed iterator of all non-empty lines in the file
:throws csv.Error: if an error is detected during CSV parsing
@@ -561,7 +557,6 @@ class Import(models.TransientModel):
matches[index] = match_field or None
return headers, matches
- @api.multi
def parse_preview(self, options, count=10):
""" Generates a preview of the uploaded files, and performs
fields-matching between the import's file data and the model's
@@ -737,7 +732,6 @@ class Import(models.TransientModel):
decimal_separator = options.get('float_decimal_separator', '.')
return thousand_separator, decimal_separator
- @api.multi
def _parse_import_data(self, data, import_fields, options):
""" Lauch first call to _parse_import_data_recursive with an
empty prefix. _parse_import_data_recursive will be run
@@ -745,7 +739,6 @@ class Import(models.TransientModel):
"""
return self._parse_import_data_recursive(self.res_model, '', data, import_fields, options)
- @api.multi
def _parse_import_data_recursive(self, model, prefix, data, import_fields, options):
# Get fields of type date/datetime
all_fields = self.env[model].fields_get()
@@ -845,7 +838,6 @@ class Import(models.TransientModel):
'error': e
})
- @api.multi
def do(self, fields, columns, options, dryrun=False):
""" Actual execution of the import