[MIG] sql_export_excel: Migration to 14.0

This commit is contained in:
hkapatel
2021-06-23 09:55:27 +05:30
committed by Maksym Yankin
parent 81ba189c52
commit cbbda68acd
3 changed files with 6 additions and 7 deletions

View File

@@ -18,7 +18,9 @@ except ImportError:
class SqlExport(models.Model):
_inherit = "sql.export"
file_format = fields.Selection(selection_add=[("excel", "Excel")])
file_format = fields.Selection(
selection_add=[("excel", "Excel")], ondelete={"excel": "set default"}
)
header = fields.Boolean(
default=True, help="Indicate if the header should be exported to the file."
)
@@ -69,7 +71,6 @@ class SqlExport(models.Model):
_("The column position can't be less than 1.")
)
@api.multi
def _get_file_extension(self):
self.ensure_one()
if self.file_format == "excel":
@@ -77,7 +78,6 @@ class SqlExport(models.Model):
else:
return super()._get_file_extension()
@api.multi
def excel_get_data_from_query(self, variable_dict):
self.ensure_one()
res = self._execute_sql_request(