Export complete template definitions as portable JSON and import them into staging, production, or upgraded databases.
Overview
Managers can snapshot one or many report templates into a JSON file that captures everything needed to recreate the setup: name, model, domain, view modes, pivot/graph/kanban settings, export columns, drills, access (groups as XML IDs, users as logins), company XML ID, and email-related fields where included in export payload.
Use JSON for backups before upgrades, consultant handoff, version control in git, and cloning demos into production-named reports.
How it works
Export uses format version 1 with magic key advance_report_studio_template_exchange. File metadata includes export timestamp and source database name (informational).
Import wizard (Configuration → Import templates (JSON)) parses the file, resolves model and group XML IDs, maps user logins, and creates or updates templates. Only Advance Report Managers may import or export.
Export entry points
- JSON button on a template list row (single template).
- Export definition (JSON) on template form header.
- Bulk export actions from exchange views when available in your build.
Step-by-step
Export (backup)
- As Manager, open Report templates.
- Click JSON on the row (or open form → Export definition (JSON)).
- Save the downloaded attachment (e.g.
monthly_sales_report.json). - Store in git, ticket, or secure file share.
Import (restore or clone)
- On target database, ensure required Odoo apps/models exist and whitelist allows models.
- Go to Configuration → Import templates (JSON).
- Upload the JSON file and complete the wizard.
- Open imported template; click Open report to validate domain and columns.
- Adjust Allowed groups/users and email recipients for the new environment.
What is included in JSON
| Section | Contents |
|---|---|
Core |
name, description, active, model (technical), domain, view_mode, action_context |
Analytics |
pivot_row/column groupby, graph_chart_mode, graph_measure, graph_groupby, kanban_groupby |
Export |
max_export_rows, export_field_names fallback, columns[] with field_name, sequence, label |
Drills |
name, sequence, target_model, domain_template |
Access |
company_xmlid, owner_login, allowed_group_xmlids[], allowed_user_logins[] |
Field explanations
Each block matches one row in the “What is included in JSON” table above, in the same order.
Core
JSON object keys for identity and window action: template name, description, active, technical model name, domain text, comma-separated view_mode, and action_context JSON string. Import requires the target database to have the same model installed (e.g. Sales for sale.order) and custom fields referenced in columns must exist or lines may be skipped.
Analytics
Pivot row/column group-by strings, graph_chart_mode, graph_measure (field name or _count), graph_groupby, and kanban_groupby-same values the template form syncs from the pivot and graph/kanban line widgets.
Export
max_export_rows, optional export_field_names fallback char, and columns array entries { field_name, sequence, label } mirroring export column lines. Drives list view regeneration after import.
Drills
Array of objects: drill name, sequence, target model technical name, and domain_template text. Target model must exist and pass whitelist rules on the destination database.
Access
company_xmlid (optional module.xml_id for res.company), owner_login, allowed_group_xmlids array, and allowed_user_logins array. Resolved on import to local IDs; fix mismatches after load. Only users in Advance Report Manager may import or export JSON.
Tips
- Tip: Export before large template experiments-you can roll back by re-importing.
- Tip: Rename in JSON or on import if cloning a demo to a production report name.
- Tip: Keep one JSON file per business report in git for audit trail.
Common mistakes
- Common mistake: Importing without Manager rights.
- Common mistake: Target DB missing app-model not found during import.
- Common mistake: Whitelist blocks model after import-template exists but cannot be saved/edited until model is allowed.