Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] component_event: Migration to 17.0 #475

Merged
merged 75 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
9e7d22f
Draft new component_event addon
guewen Jun 17, 2017
79dce45
Hold a component registry per database
guewen Jun 17, 2017
6cb4728
Add cache in component_event
guewen Jun 18, 2017
b557ff1
Complete component_event
guewen Jun 19, 2017
f07434c
Prevent trigger of events before registry is ready
guewen Jun 19, 2017
a7bc10c
Fix test: post_install
guewen Jun 19, 2017
c8b38d1
Move base component in a components directory
guewen Jun 20, 2017
daa9ff6
Check that component registry is ready for events
guewen Jun 20, 2017
c40a71b
Ignore W0104 pylint warnings in tests
guewen Jun 20, 2017
7cd6a66
Remove doc about creating abstract listener
guewen Jun 20, 2017
3f01769
Correct event name in doc and add signature
guewen Jun 21, 2017
ee00ec2
Remove RecordsEventListener
guewen Jun 21, 2017
6679b5a
Add @skip_if decorator to skip events
guewen Jun 22, 2017
6da3c84
Notify unlink event before the unlink
guewen Jun 22, 2017
e1a195a
Simplify tests by loading modules components
guewen Jun 30, 2017
e33221e
Remove model_name in _event()
guewen Jun 30, 2017
df85b0a
Add readme files
guewen Jul 11, 2017
f9d9280
Fix cache of events
guewen Jul 17, 2017
f737d67
[IMP] component_event: Document implemented events
lasley Aug 30, 2017
2d6b1ce
[FIX] component_event: Link to pre-existing docs for model events
lasley Aug 30, 2017
7829a3c
[MIG] Set modules uninstallable
guewen Oct 3, 2017
8a0e1e8
Make addons installable
guewen Oct 3, 2017
0d6ca06
PY3: apply automated changes by 2to3 on addons
guewen Oct 3, 2017
28b1d0e
Fix some pylint-odoo warnings
guewen Oct 3, 2017
7f0a615
OCA Transbot updated translations from Transifex
oca-transbot Feb 17, 2018
77a9d56
[UPD] Update component_event.pot
oca-travis Jun 23, 2018
683229e
Improve documentation of APIs
guewen Mar 30, 2018
e833052
[MIG] Make modules uninstallable
OCA-git-bot Sep 26, 2018
f8f5dee
Migrate component_event to 12.0
guewen Nov 26, 2018
72bc7a7
[UPD] README.rst
OCA-git-bot Jan 14, 2019
c8df4bd
[UPD] Update component_event.pot
oca-travis Jan 14, 2019
222442c
Update translation files
oca-transbot Jan 27, 2019
f70ff75
component, component_event: tag unittest.TestCase subclasses
naglis Mar 19, 2019
9918f13
[ADD] icon.png
OCA-git-bot Apr 3, 2019
1852b9b
Fix compatibility with cachetools 3.0.0
guewen Apr 12, 2019
17174e2
[UPD] README.rst
OCA-git-bot Jul 29, 2019
2802558
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
fcf546f
Translated using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
f9bbb93
Set modules uninstallable
guewen Oct 10, 2019
b3493ec
[MIG] component_event: Migration to 13.0
damdam-s Oct 11, 2019
83162bc
[MIG] test_component: Migration to 13.0
damdam-s Oct 11, 2019
011a279
[12.0][CHG] connector: Use more permissive licence: AGPL-> LGPL
lmignon Oct 14, 2019
c89fe73
black, isort
lmignon Oct 23, 2019
eaf759c
[MIG] component, component_event, test_component: Installable True
lmignon Oct 23, 2019
495c4c4
[UPD] Update component_event.pot
oca-travis Oct 30, 2019
f1f5600
[UPD] README.rst
OCA-git-bot Oct 30, 2019
083d420
Recover the v13 new feature of create method with a list of vals on Base
jbaudoux May 25, 2020
83d593e
component_event: 13.0.1.0.1
guewen May 26, 2020
cea8fd4
MIGR 14.0 component_event
bealdav Oct 12, 2020
c03661c
FIX component: add py3.8 backport to make test right
bealdav Oct 26, 2020
09d9c80
[UPD] Update component_event.pot
oca-travis Oct 26, 2020
cb7a435
[UPD] README.rst
OCA-git-bot Oct 26, 2020
6557146
[IMP] update dotfiles
OCA-git-bot Dec 12, 2020
14db578
component_event 14.0.1.0.1
OCA-git-bot Dec 12, 2020
78a4003
component_event: allow propagation of custom registry
simahawk Nov 5, 2020
273e702
component_event: adapt test class usage
simahawk Nov 9, 2020
ddf711e
component_event 14.0.1.0.2
OCA-git-bot Jan 4, 2021
cd5cb72
Initialize 15.0 branch
lmignon Nov 25, 2021
562ac56
[MIG][15.0] component_event
i-vyshnevska Dec 2, 2021
5b467c7
[MIG][15.0] test_connector
i-vyshnevska Dec 2, 2021
26b2a31
[UPD] Update component_event.pot
Jan 25, 2022
c95ef17
[UPD] README.rst
OCA-git-bot Jan 25, 2022
4ffd1ba
[REF] remove explicit 'object' inheritance
florentx Jan 27, 2022
d2ac508
component_event 15.0.1.0.1
OCA-git-bot Aug 1, 2022
c169bcd
[16.0][MIG] component_event: Migration to 16.0
asierneiradev Sep 28, 2022
63ef48f
[UPD] Update component_event.pot
Feb 2, 2023
2a46d7c
[UPD] README.rst
OCA-git-bot Feb 2, 2023
05cd4d9
Update translation files
weblate Feb 2, 2023
810a7de
component_event: fix test class
simahawk Mar 2, 2023
95e94da
component_event 16.0.1.0.1
OCA-git-bot Mar 2, 2023
008f295
Added translation using Weblate (Spanish)
Ivorra78 Aug 2, 2023
350fb88
Translated using Weblate (Spanish)
Ivorra78 Aug 2, 2023
a5ad14a
[UPD] README.rst
OCA-git-bot Sep 3, 2023
23fd3aa
[IMP] component_event: black, isort, prettier
nguyenminhchien Nov 23, 2023
4f7836d
[MIG] component_event: Migration to 17.0
nguyenminhchien Dec 8, 2023
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
133 changes: 133 additions & 0 deletions component_event/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
=================
Components Events
=================

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

.. |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/licence-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/17.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-17-0/connector-17-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=17.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:%2017.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 <[email protected]>

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/17.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": "17.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