TIP: You can type at any time to perform a new search.
Excel Import/Export/Report
excel_import_export · OCA/server-tools
- Repository
- OCA/server-tools · module folder · Try on Runboat
- Module version
- 1.0.0
- Category
- Tools
- Folder size
- 0.55 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/server-tools
- Last tracking update
- 2026-08-07 08:42:57
- Authors
- Odoo Community Association (OCA), Ecosoft
- Maintainers
- Odoo Community Association (OCA), Ecosoft
- Committers
- Duy (Đỗ Anh), Weblate, OCA-git-bot, oca-ci
- Odoo dependencies
- Python dependencies
- openpyxl
- System dependencies
- None
- Required by
- None
- Description
The module provide pre-built functions and wizards for developer to build excel import / export / report with ease. Without having to code to create excel file, developer do, - Create menu, action, wizard, model, view a normal Odoo development. - Design excel template using standard Excel application, e.g., colors, fonts, formulas, etc. - Instruct how the data will be located in Excel with simple dictionary instruction or from Odoo UI. - Odoo will combine instruction with excel template, and result in final excel file.
Code Analysis ⓘ
Views touched (6)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
export_xlsx_wizard |
export.xlsx.wizard | export.xlsx.wizard | form | New |
import_xlsx_wizard |
import.xlsx.wizard | import.xlsx.wizard | form | New |
report_xlsx_wizard |
report.xlsx.wizard | report.xlsx.wizard | form | New |
view_xlsx_template_form |
xlsx.template | form | New | |
view_xlsx_template_tree |
xlsx.template | list | New | |
xlsx_report_view |
xlsx.report.view | xlsx.report | form | New |
HTTP endpoints (2)
| Route(s) | Handler | Auth | Type | Methods | Flags |
|---|---|---|---|---|---|
| (inherited route override) | ReportExcelController.report_download |
inherited | http | ALL | |
| (inherited route override) | ReportExcelController.report_routes |
inherited | http | ALL |
Models touched (11)
New fields (6)
-
dataBinaryreadonly=Truestring='File' -
nameCharreadonly=Truesize=500string='File Name' -
res_idsCharreadonly=Truerequired=Truestring='Resource IDs' -
res_modelCharreadonly=Truerequired=Truesize=500string='Resource Model' -
stateSelectiondefault='choose'help='* Choose: wizard show in user selection mode\n* Get: wizard show results from user action' args: [('choose', 'Choose'), ('get', 'Get')] -
template_idMany2one → xlsx.templatedomain=<expr>ondelete='cascade'required=Truestring='Template' args: 'xlsx.template'
-
action_export(self) -
default_get(self, fields)@api.model
New fields (9)
-
attachment_idsMany2many → ir.attachmenthelp='You can select multiple files to import.'required=Truestring='Import File(s) (*.xlsx)' args: 'ir.attachment' -
datasBinaryreadonly=Truerelated='template_id.datas'string='Sample' -
filenameCharargs: 'Import File Name' -
fnameCharreadonly=Truerelated='template_id.fname'string='Template Name' -
import_fileBinarystring='Import File (*.xlsx)' -
res_idIntegerreadonly=Truestring='Resource ID' -
res_modelCharreadonly=Truesize=500string='Resource Model' -
stateSelectiondefault='choose'help='* Choose: wizard show in user selection mode\n* Get: wizard show results from user action' args: [('choose', 'Choose'), ('get', 'Get')] -
template_idMany2one → xlsx.templatedomain=<expr>ondelete='cascade'required=Truestring='Template' args: 'xlsx.template'
-
action_import(self) -
check_view_init(self, context)This template only works on some context of active record -
default_get(self, fields_list)@api.model -
get_import_sample(self)
New fields (1)
-
report_typeSelectionondelete={'excel': 'cascade'}selection_add=[('excel', 'Excel')]
No public methods.
New fields (2)
-
domainCharstring='Search Criterias' -
res_modelChar
-
action_report(self) -
safe_domain(self, str_domain)
New fields (0)
No new fields.
Public methods (7)-
apply_extra_conditions_to_value(self, field, value, conditions_dict) -
export_xlsx(self, template, res_model, res_ids)@api.model -
get_eval_context(self, model, record, value)@api.model -
run_aggre_func_dict(self, field) -
run_field_cond_dict(self, field) -
run_field_style_dict(self, field) -
run_style_cond_dict(self, field)
New fields (0)
No new fields.
Public methods (3)-
get_eval_context(self, model=False, value=False)@api.model -
get_external_id(self, record)@api.modelGet external ID of the record, if not already exists create one -
import_xlsx(self, import_file, template, res_model=False, res_id=False)@api.model- If res_id = False, we want to create new document first - Delete fields' data according to data_dict['__IMPORT__'] - Import data from excel according to data_dict['__IMPORT__']
New fields (5)
-
choose_templateBooleandefault=Falsestring='Allow Choose Template' -
dataBinaryreadonly=Truestring='File' -
nameCharreadonly=Truesize=500string='File Name' -
stateSelectiondefault='choose'help='* Choose: wizard show in user selection mode\n* Get: wizard show results from user action' args: [('choose', 'Choose'), ('get', 'Get')] -
template_idMany2one → xlsx.templatedomain=<expr>ondelete='cascade'required=Truestring='Template' args: 'xlsx.template'
-
default_get(self, fields)@api.model -
report_xlsx(self)
New fields (0)
No new fields.
Public methods (1)-
get_openpyxl_styles(self)@api.modelList all syles that can be used with styleing directive #{...}
New fields (24)
-
csv_delimiterChardefault=','help='Optional for CSV, default is comma.'required=Truesize=1string='CSV Delimiter' -
csv_extensionChardefault='csv'help='Optional for CSV, default is .csv'required=Truesize=5string='CSV File Extension' -
csv_quoteBooleandefault=Truehelp='Optional for CSV, default is full quoting.'string='CSV Quoting' -
datasBinarystring='File Content' -
descriptionChar -
export_action_idMany2one → ir.actions.act_windowcomodel_name='ir.actions.act_window'ondelete='set null' -
export_idsOne2many → xlsx.template.exportcomodel_name='xlsx.template.export'inverse_name='template_id' -
fnameCharstring='File Name' -
gnameCharhelp='Multiple template of same model, can belong to same group,\nresult in multiple template selection'string='Group Name' -
import_action_idMany2one → ir.actions.act_windowcomodel_name='ir.actions.act_window'ondelete='set null' -
import_idsOne2many → xlsx.template.importcomodel_name='xlsx.template.import'inverse_name='template_id' -
input_instructionTexthelp='This is used to construct instruction in tab Import/Export'string='Instruction (Input)' -
instructionTextcompute='_compute_output_instruction'help='Instruction on how to import/export, prepared by system.' -
nameCharrequired=Truestring='Template Name' -
post_import_hookCharhelp='Call a function after successful import, i.e.,\n${object.post_import_do_something()}'string='Post Import Function Hook' -
redirect_actionMany2one → ir.actions.act_windowcomodel_name='ir.actions.act_window'domain=[('type', '=', 'ir.actions.act_window')]help='Optional action, redirection after finish import operation'string='Return Action' -
report_action_idMany2one → ir.actions.reportcomodel_name='ir.actions.report'string='Report Action' -
report_menu_idMany2one → ir.ui.menucomodel_name='ir.ui.menu'readonly=Truestring='Report Menu' -
res_modelCharhelp='The database object this attachment will be attached to.'string='Resource Model' -
result_fieldCharcompute='_compute_result_field' -
result_model_idMany2one → ir.modelcomodel_name='ir.model'help='When use commone wizard, choose the result model'string='Report Model' -
show_instructionBooleandefault=Falsehelp='This is the computed instruction based on tab Import/Export,\nto be used by xlsx import/export engine'string='Show Output' -
to_csvBooleandefault=Falsehelp='Convert file into CSV format on export'string='Convert to CSV?' -
use_report_wizardBooleanhelp='Use common report wizard model, instead of create specific model'string='Easy Reporting'
-
add_export_action(self) -
add_import_action(self) -
add_report_menu(self) -
create(self, vals_list)@api.model_create_multi -
load_xlsx_template(self, template_ids, addon=False)@api.model -
remove_export_action(self) -
remove_import_action(self) -
remove_report_menu(self) -
unlink(self) -
write(self, vals)
New fields (13)
-
excel_cellCharstring='Cell' -
field_condCharstring='Field Cond.' -
field_nameCharstring='Field' -
is_contBooleandefault=Falsehelp='Continue data rows after last data row'string='Continue' -
is_extendBooleandefault=Falsehelp='Extend a blank row after filling each record, to extend the footer'string='Extend' -
is_sumBooleandefault=Falsestring='Sum' -
row_fieldCharhelp='If section type is row, this field is required' -
section_typeSelectionrequired=True args: [('sheet', 'Sheet'), ('head', 'Head'), ('row', 'Row'), ('data', 'Data')] -
sequenceIntegerdefault=10 -
sheetChar -
styleCharstring='Default Style' -
style_condCharstring='Style w/Cond.' -
template_idMany2one → xlsx.templatecomodel_name='xlsx.template'index=Trueondelete='cascade'readonly=Truestring='XLSX Template'
-
create(self, vals_list)@api.model_create_multi
New fields (9)
-
excel_cellCharstring='Cell' -
field_condCharstring='Field Cond.' -
field_nameCharstring='Field' -
no_deleteBooleandefault=Falsehelp='By default, all rows will be deleted before import.\nSelect No Delete, otherwise' -
row_fieldCharhelp='If section type is row, this field is required' -
section_typeSelectionrequired=True args: [('sheet', 'Sheet'), ('head', 'Head'), ('row', 'Row'), ('data', 'Data')] -
sequenceIntegerdefault=10 -
sheetChar -
template_idMany2one → xlsx.templatecomodel_name='xlsx.template'index=Trueondelete='cascade'readonly=Truestring='XLSX Template'
-
create(self, vals_list)@api.model_create_multi
Loading…
Loading…
Loading…
Loading…
Loading…
- Status
- Open migration PR — not merged yet for this version
- CI status
- checks failing
- Open since
- 764 days ago
- Last activity
- 266 days ago
- Repository
- OCA/server-tools
- Pull request
- [17.0] mig-excel_import_export (#2991)
- Status
- Open migration PR — not merged yet for this version
- CI status
- checks failing
- Open since
- 170 days ago
- Last activity
- 128 days ago
- Repository
- OCA/server-tools
- Pull request
- [19.0][MIG] excel_import_export: Migration to 19.0 (#3537)