|
| 1 | +# Copyright 2026 ACSONE SA/NV |
| 2 | +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
| 3 | + |
| 4 | +"""These classes are a response to the use of initial export controllers |
| 5 | +in the export async job. |
| 6 | +
|
| 7 | +It is used to avoid an issue when the export async job is executed |
| 8 | +without a proper inbound object. |
| 9 | +""" |
| 10 | + |
| 11 | +from odoo.addons.web.controllers.export import CSVExport as CSVExportController |
| 12 | +from odoo.addons.web.controllers.export import ExcelExport as ExcelExportController |
| 13 | +from odoo.addons.web.controllers.export import ExportFormat |
| 14 | + |
| 15 | + |
| 16 | +class CSVExport(ExportFormat): |
| 17 | + @property |
| 18 | + def content_type(self): |
| 19 | + return CSVExportController.content_type.fget(self) |
| 20 | + |
| 21 | + @property |
| 22 | + def extension(self): |
| 23 | + return CSVExportController.extension.fget(self) |
| 24 | + |
| 25 | + def from_data(self, fields, rows): |
| 26 | + return CSVExportController.from_data(self, fields, rows) |
| 27 | + |
| 28 | + |
| 29 | +class ExcelExport(ExportFormat): |
| 30 | + @property |
| 31 | + def content_type(self): |
| 32 | + return ExcelExportController.content_type.fget(self) |
| 33 | + |
| 34 | + @property |
| 35 | + def extension(self): |
| 36 | + return ExcelExportController.extension.fget(self) |
| 37 | + |
| 38 | + def from_group_data(self, fields, groups): |
| 39 | + return ExcelExportController.from_group_data(self, fields, groups) |
| 40 | + |
| 41 | + def from_data(self, fields, rows): |
| 42 | + return ExcelExportController.from_data(self, fields, rows) |
0 commit comments