OdooWiki OCA HUB

Components Events

component_event folder_open OCA/connector open_in_new
Generic Modules License: LGPL-3

This module implements an event system (Observer pattern) and is a base block for the Connector Framework. It can be used without using the full Connector though. It is built upon the component module.

Documentation:

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

Adds an internal event system to Odoo so that other modules can react automatically when records are created, changed or deleted. It is a technical building block with no menus or screens for end users.

This module is a technical foundation, not a business feature. It gives every Odoo model the ability to announce that something happened, and lets other modules register listeners that react to those announcements.

  • Three automatic announcements are sent by Odoo itself: when a record is created, when it is modified, and just before it is deleted. The announcement includes the record and the list of fields that were changed.
  • Other modules can also announce their own custom events, for example when a specific button is pressed, and any number of listeners can react to the same event.
  • Listeners can be limited to a particular model or to a particular external system (called a collection), so that only the relevant ones run.
  • A listener can be skipped automatically based on a condition, for instance when a special context flag is set.
  • The list of listeners for each event is cached for speed and refreshed when Odoo reloads its registry.

There are no menus, screens, reports, emails or scheduled jobs in this module. It only touches the base model shared by all Odoo models and adds two internal components, base.event.collecter and base.event.listener. Business users will not see anything directly; they will only notice the effects of other modules built on top of it.

Depends on

Models and fields (3)
  • base · extends an existing model
  • base.event.listener · new model
  • base.event.collecter · new model

Text generated by AI (DeepSeek) from reading the Odoo 19.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 8 confirmed, 1 with no information of 9 versions.

Sources · Odoo 19.0

Confirmed on 2026-11-03 in branch 19.0 of OCA/connector.

terminal Installation and usage

OCA documentation · Odoo 19.0

As a developer, you have access to a events system. You can find the documentation in the code or on

In a nutshell, you can create trigger events:

class Base(models.AbstractModel): _inherit = 'base'

@api.model def create(self, vals): record = super(Base, self).create(vals) self._event('on_record_create').notify(record, fields=vals.keys()) return record

And subscribe listeners to the events:

from odoo.addons.component.core import Component from odoo.addons.component_event import skip_if

class MagentoListener(Component): _name = 'magento.event.listener' _inherit = 'base.connector.listener'

@skip_if(lambda self, record, **kwargs: self.no_connector_export(record)) def on_record_create(self, record, fields=None): """ Called when a record is created """ record.with_delay().export_record(fields=fields)

This module triggers 3 events:

  • on_record_create(record, fields=None)
  • on_record_write(record, fields=None)
  • on_record_unlink(record)

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.