Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
cf7f980
Draft new component_event addon
Jun 17, 2017
aea3cac
Hold a component registry per database
Jun 17, 2017
02c8ca8
Add cache in component_event
Jun 18, 2017
ddb019e
Complete component_event
Jun 19, 2017
74150b6
Prevent trigger of events before registry is ready
Jun 19, 2017
8557436
Fix test: post_install
Jun 19, 2017
88c785c
Move base component in a components directory
Jun 20, 2017
3c1472b
Check that component registry is ready for events
Jun 20, 2017
d70c609
Ignore W0104 pylint warnings in tests
Jun 20, 2017
9c8d60f
Remove doc about creating abstract listener
Jun 20, 2017
b7e4c57
Correct event name in doc and add signature
Jun 21, 2017
e10b91e
Remove RecordsEventListener
Jun 21, 2017
0ce80db
Add @skip_if decorator to skip events
Jun 22, 2017
386a263
Notify unlink event before the unlink
Jun 22, 2017
974211c
Simplify tests by loading modules components
Jun 30, 2017
10a3b92
Remove model_name in _event()
Jun 30, 2017
4af1c5d
Add readme files
Jul 11, 2017
09d5dc6
Fix cache of events
Jul 17, 2017
e38fc64
[IMP] component_event: Document implemented events
lasley Aug 30, 2017
0c1cf64
[FIX] component_event: Link to pre-existing docs for model events
lasley Aug 30, 2017
e6953f6
[MIG] Set modules uninstallable
Oct 3, 2017
e236939
Make addons installable
Oct 3, 2017
a4e6f73
PY3: apply automated changes by 2to3 on addons
Oct 3, 2017
f1c57aa
Fix some pylint-odoo warnings
Oct 3, 2017
27dc793
OCA Transbot updated translations from Transifex
oca-transbot Feb 17, 2018
0372b9b
[UPD] Update component_event.pot
oca-travis Jun 23, 2018
b8a26a5
Improve documentation of APIs
Mar 30, 2018
5cd0024
[MIG] Make modules uninstallable
OCA-git-bot Sep 26, 2018
086b4b0
Migrate component_event to 12.0
Nov 26, 2018
0a00850
[UPD] README.rst
OCA-git-bot Jan 14, 2019
b8bbb05
[UPD] Update component_event.pot
oca-travis Jan 14, 2019
d0e9556
Update translation files
oca-transbot Jan 27, 2019
c5def79
component, component_event: tag unittest.TestCase subclasses
naglis Mar 19, 2019
e68002c
[ADD] icon.png
OCA-git-bot Apr 3, 2019
d4f16e7
Fix compatibility with cachetools 3.0.0
Apr 12, 2019
96ecbab
[UPD] README.rst
OCA-git-bot Jul 29, 2019
84f5952
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
fd6c9f7
Translated using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
e8db9bc
Set modules uninstallable
Oct 10, 2019
d7f551f
[MIG] component_event: Migration to 13.0
damdam-s Oct 11, 2019
8d4e3d5
[MIG] test_component: Migration to 13.0
damdam-s Oct 11, 2019
850516b
[12.0][CHG] connector: Use more permissive licence: AGPL-> LGPL
lmignon Oct 14, 2019
ee20170
black, isort
lmignon Oct 23, 2019
3912b28
[MIG] component, component_event, test_component: Installable True
lmignon Oct 23, 2019
b50f56f
[UPD] Update component_event.pot
oca-travis Oct 30, 2019
0b7ac5d
[UPD] README.rst
OCA-git-bot Oct 30, 2019
32839b9
Recover the v13 new feature of create method with a list of vals on Base
jbaudoux May 25, 2020
c44029f
component_event: 13.0.1.0.1
May 26, 2020
234adfb
MIGR 14.0 component_event
bealdav Oct 12, 2020
5fd4a94
FIX component: add py3.8 backport to make test right
bealdav Oct 26, 2020
bf56e8f
[UPD] Update component_event.pot
oca-travis Oct 26, 2020
99336c9
[UPD] README.rst
OCA-git-bot Oct 26, 2020
f6c8620
[IMP] update dotfiles
OCA-git-bot Dec 12, 2020
6d3607c
component_event 14.0.1.0.1
OCA-git-bot Dec 12, 2020
ac10dfa
component_event: allow propagation of custom registry
simahawk Nov 5, 2020
5fae100
component_event: adapt test class usage
simahawk Nov 9, 2020
43c5249
component_event 14.0.1.0.2
OCA-git-bot Jan 4, 2021
6f4b56a
Initialize 15.0 branch
lmignon Nov 25, 2021
3ec17d9
[MIG][15.0] component_event
i-vyshnevska Dec 2, 2021
75c1aaa
[MIG][15.0] test_connector
i-vyshnevska Dec 2, 2021
9b67073
[UPD] Update component_event.pot
Jan 25, 2022
96dec43
[UPD] README.rst
OCA-git-bot Jan 25, 2022
57ae33a
[REF] remove explicit 'object' inheritance
florentx Jan 27, 2022
80ec85f
component_event 15.0.1.0.1
OCA-git-bot Aug 1, 2022
78f93c5
[16.0][MIG] component_event: Migration to 16.0
asierneiradev Sep 28, 2022
eff81de
[UPD] Update component_event.pot
Feb 2, 2023
b38beef
[UPD] README.rst
OCA-git-bot Feb 2, 2023
b74e542
Update translation files
weblate Feb 2, 2023
23ee3d0
component_event: fix test class
simahawk Mar 2, 2023
ceb8f39
component_event 16.0.1.0.1
OCA-git-bot Mar 2, 2023
771941a
Added translation using Weblate (Spanish)
Ivorra78 Aug 2, 2023
2b43a0e
Translated using Weblate (Spanish)
Ivorra78 Aug 2, 2023
8672ea0
[UPD] README.rst
OCA-git-bot Sep 3, 2023
76b53c3
[IMP] component_event: black, isort, prettier
nguyenminhchien Nov 23, 2023
7f38f96
[MIG] component_event: Migration to 17.0
nguyenminhchien Dec 8, 2023
766aeae
[UPD] Update component_event.pot
Dec 9, 2023
ce30b71
[BOT] post-merge updates
OCA-git-bot Dec 9, 2023
8ee412e
Added translation using Weblate (Italian)
mymage Feb 4, 2024
b37d253
Translated using Weblate (Italian)
mymage Feb 4, 2024
b85039b
[MIG] component_event: Migration to 18.0
thienvh332 Sep 19, 2024
0df11b4
[UPD] Update component_event.pot
Oct 9, 2024
116b48e
[BOT] post-merge updates
OCA-git-bot Oct 9, 2024
daac93a
[MIG] component_event Migration to 19.0
Sanazzzmi Oct 13, 2025
18acfd5
[UP]Remove op tag
Sanazzzmi Oct 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions component_event/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=================
Components Events
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:97bef8a6c3971c475f2ebe58ebed781490658d2174669d49ee22cea9869fc0a0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fconnector-lightgray.png?logo=github
:target: https://github.com/OCA/connector/tree/19.0/component_event
:alt: OCA/connector
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/connector-19-0/connector-19-0-component_event
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/connector&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module implements an event system (`Observer
pattern <https://en.wikipedia.org/wiki/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: http://odoo-connector.com/

**Table of contents**

.. contents::
:local:

Usage
=====

As a developer, you have access to a events system. You can find the
documentation in the code or on http://odoo-connector.com

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)``

Changelog
=========

Next
----

12.0.1.0.0 (2018-11-26)
-----------------------

- [MIGRATION] from 12.0 branched at rev. 324e006

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/connector/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/connector/issues/new?body=module:%20component_event%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Camptocamp

Contributors
------------

- Guewen Baconnier <guewen.baconnier@camptocamp.com>

Other credits
-------------

The migration of this module from 18.0 to 19.0 was financially supported
by Camptocamp.

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/connector <https://github.com/OCA/connector/tree/19.0/component_event>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 6 additions & 0 deletions component_event/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from . import core
from . import components
from . import models

# allow public API 'from odoo.addons.component_event import skip_if'
from .components.event import skip_if # noqa
15 changes: 15 additions & 0 deletions component_event/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2019 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)

{
"name": "Components Events",
"version": "19.0.1.0.0",
"author": "Camptocamp,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/connector",
"license": "LGPL-3",
"category": "Generic Modules",
"depends": ["component"],
"external_dependencies": {"python": ["cachetools"]},
"data": [],
"installable": True,
}
1 change: 1 addition & 0 deletions component_event/components/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import event
Loading
Loading