Components Events

Components Events

by Contaura LLC · original work by Camptocamp, OCA
component_event
$ 29.00

1.0
Needs 1 more store app, added with it: Total $ 108.00

One purchase covers every version. Already bought it? Sign in.

Components Events

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:

Table of contents

Usage

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 tulio.addons.component.core import Component
from tulio.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)

Changelog

12.0.1.0.0 (2018-11-26)

  • [MIGRATION] from 12.0 branched at rev. 324e006
Technical namecomponent_event
Module version12.0.1.1.0
Tulio versions1.0
CategoryTools
PublisherContaura LLC
Ported to Tulio, tested and supported by Contaura LLC.
Original authorsCamptocamp, OCA
LicenseLGPL-3
Open source: you may use, change and share this module under its license. The price covers the Tulio port, its testing on Tulio 1.0 and the download.
Python librariescachetools
Install them on the server with pip before installing the module.
Requires (store) Components
Lines of code813
Downloads0
Released12/06/2026
12.0.1.1.0 Tulio 1.0 · 12/06/2026