| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 647 |
| Technical Name |
import_step_events |
| License | AGPL-3 |
| Website | https://github.com/tawasta/server-tools |
Import Step: Events
Adds an Events + Registrations import step for the import_core framework.
This module registers:
- Import step: event
- Runner model: generic.import.runner.event
The step integrates with the generic dispatcher provided by import_core.
Features
The event import step supports:
- Creating events
- Reusing existing events via search fields
- Creating event registrations
- Reusing existing registrations via search fields
- Shared import state integration
- Automatic event-registration linking
- Integration with previous import steps
The module depends on:
- import_core
- event
Import step registration
The module registers the following import step:
<record id="generic_import_step_event" model="generic.import.step"> <field name="name">Events + Registrations</field> <field name="code">event</field> <field name="sequence">20</field> <field name="required_models"> event.event,event.registration </field> </record>
This means:
The dispatcher executes runner:
generic.import.runner.event
The step is only available when models:
- event.event
- event.registration
are installed.
Configuration
Install modules:
- import_core
- event
- import_step_events
Open:
Imports -> Templates
Create or edit a template
Add import step:
- Events + Registrations
Configure field mappings for models:
- event.event
- event.registration
Optionally mark fields as:
- Is search field
Search fields are used to find existing records before creating new ones.
Usage
Event import
Map CSV/XLSX columns to event.event fields.
Example mappings:
- Event Name -> event.event.name
- Start Date -> event.event.date_begin
- End Date -> event.event.date_end
Import behavior:
- Existing events are reused when search fields match
- New events are created when no match exists
Example CSV
Event Name,Start Date,End Date Demo Event,2026-01-01 09:00:00,2026-01-01 16:00:00
Registration import
Map CSV/XLSX columns to event.registration fields.
Example mappings:
- Registration Name -> event.registration.name
- Email -> event.registration.email
Import behavior:
- Existing registrations are reused when search fields match
- New registrations are created when no match exists
Automatic event linking
The runner automatically links registrations to the imported event.
Implementation flow:
event = self._get_or_create_from_lines( "event.event", ... ) registration = self._get_or_create_from_lines( "event.registration", ... )
The event record is stored into shared import state:
state = self._set_state_record( state, "event", event, )
This allows state links to assign:
- event.registration.event_id
automatically.
Partner integration
The module integrates with previous import steps.
Example:
- import_step_contacts creates/fetches a partner
- Partner is stored into shared import state
- Event registration step reuses the partner
Typical state link configuration:
source_state_key = partner target_model = event.registration target_field = partner_id
This enables automatic registration-partner linking.
Search field behavior
Fields marked as Is search field are used to build lookup domains.
Example:
- name marked as search field on event.event
The runner performs:
self.env["event.event"].search([ ("name", "=", value) ], limit=1)
If a matching record is found:
- Existing record is reused
- Duplicate creation is avoided
Technical implementation
The runner inherits:
_inherit = "generic.import.runner.base"
Available helper methods include:
- _get_or_create()
- _get_or_create_from_lines()
- _build_domain()
- _clean_vals()
- _set_state_record()
Import flow
Simplified processing order:
- Read mapped event values
- Search/create event
- Store event into state
- Read mapped registration values
- Search/create registration
- Store registration into state
- Apply configured state links
Dependencies
Python dependencies:
- None
Odoo dependencies:
- import_core
- event
Known issues / Roadmap
Credits
Contributors
- Valtteri Lattu <valtteri.lattu@tawasta.fi>
Maintainer
This module is maintained by Oy Tawasta OS Technologies Ltd.
Please log in to comment on this module