Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
137 changes: 137 additions & 0 deletions event_multi_company/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
===================
Event multi-company
===================

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

.. |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-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmulti--company-lightgray.png?logo=github
:target: https://github.com/OCA/multi-company/tree/18.0/event_multi_company
:alt: OCA/multi-company
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/multi-company-18-0/multi-company-18-0-event_multi_company
: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/multi-company&target_branch=18.0
:alt: Try me on Runboat

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

Based on ``base_multi_company`` module. Adds a ``company_ids`` Many2many
on ``event.event`` so an event can be assigned to several companies at
once. The standard ``company_id`` field becomes a computed/searched
proxy over ``company_ids`` via ``multi.company.abstract``.

Backend visibility is handled transparently by Odoo's standard
multi-company record rule on ``event.event``, which
``multi.company.abstract`` automatically reroutes through
``company_ids``.

If the optional ``website_event`` module is installed, the same rule
applies to the public ``/event`` listing on each website: an event is
only displayed on the websites of the companies listed in its
``company_ids``. No bridge module is needed.

Same pattern as ``product_multi_company`` and ``partner_multi_company``.

**Table of contents**

.. contents::
:local:

Installation
============

Depends on ``base_multi_company`` (OCA/multi-company) and ``event``
(core).

A ``post_init_hook`` copies each event's existing ``company_id`` into
the new ``company_ids`` field, so pre-existing events keep their
visibility.

Uninstall does **not** automatically restore the upstream ``company_id``
behaviour. Run ``-u event`` afterwards (or restore from a backup) to
fully revert.

Usage
=====

On the event form, the standard *Company* field is replaced by a
*Companies* many2many tags field (visible to users of the *Multi
Companies* group).

- Leave it empty → event accessible from every company (legacy
behaviour).
- Pick one or several companies → event accessible only to users of
those companies.

If the ``website_event`` module is installed:

- An event with empty ``company_ids`` is displayed on every website.
- An event with one or more companies is only displayed on the websites
of those companies.
- If you also set the per-event *Website* field, the event is restricted
to that single website. The website's company must be one of the
event's companies (upstream constraint).

Known issues / Roadmap
======================

- ``event.registration`` is not multi-company. A future
``event_registration_multi_company`` companion module would extend the
same pattern.
- Other OCA event addons (``event_session``, ``event_sale_session``,
etc.) are not audited for compatibility.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/multi-company/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/multi-company/issues/new?body=module:%20event_multi_company%0Aversion:%2018.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
-------

* INVITU

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

- `INVITU <https://www.invitu.com>`__:

- Cyril VINH-TUNG <cyril@invitu.com>

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/multi-company <https://github.com/OCA/multi-company/tree/18.0/event_multi_company>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions event_multi_company/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import post_init_hook
22 changes: 22 additions & 0 deletions event_multi_company/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2026 INVITU (<https://www.invitu.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Event multi-company",
"summary": "Assign an event to several companies (backend only).",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "INVITU, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/multi-company",
"category": "Marketing",
"depends": [
"base_multi_company",
"event",
],
"data": [
"views/event_event_view.xml",
],
"post_init_hook": "post_init_hook",
"installable": True,
"application": False,
}
15 changes: 15 additions & 0 deletions event_multi_company/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2026 INVITU (<https://www.invitu.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import logging

_logger = logging.getLogger(__name__)

try:
from odoo.addons.base_multi_company import hooks
except ImportError:
_logger.info("Cannot find `base_multi_company` module in addons path.")


def post_init_hook(env):
hooks.fill_company_ids(env, "event.event")
1 change: 1 addition & 0 deletions event_multi_company/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import event_event
9 changes: 9 additions & 0 deletions event_multi_company/models/event_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2026 INVITU (<https://www.invitu.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class EventEvent(models.Model):
_inherit = ["multi.company.abstract", "event.event"]
_name = "event.event"
3 changes: 3 additions & 0 deletions event_multi_company/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions event_multi_company/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [INVITU](https://www.invitu.com):
- Cyril VINH-TUNG \<<cyril@invitu.com>\>
15 changes: 15 additions & 0 deletions event_multi_company/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Based on ``base_multi_company`` module.
Adds a ``company_ids`` Many2many on ``event.event`` so an event can be assigned
to several companies at once. The standard ``company_id`` field becomes a
computed/searched proxy over ``company_ids`` via ``multi.company.abstract``.

Backend visibility is handled transparently by Odoo's standard multi-company
record rule on ``event.event``, which ``multi.company.abstract`` automatically
reroutes through ``company_ids``.

If the optional ``website_event`` module is installed, the same rule applies
to the public ``/event`` listing on each website: an event is only displayed
on the websites of the companies listed in its ``company_ids``. No bridge
module is needed.

Same pattern as ``product_multi_company`` and ``partner_multi_company``.
8 changes: 8 additions & 0 deletions event_multi_company/readme/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Depends on ``base_multi_company`` (OCA/multi-company) and ``event`` (core).

A ``post_init_hook`` copies each event's existing ``company_id`` into the new
``company_ids`` field, so pre-existing events keep their visibility.

Uninstall does **not** automatically restore the upstream ``company_id``
behaviour. Run ``-u event`` afterwards (or restore from a backup) to fully
revert.
5 changes: 5 additions & 0 deletions event_multi_company/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* ``event.registration`` is not multi-company. A future
``event_registration_multi_company`` companion module would extend the same
pattern.
* Other OCA event addons (``event_session``, ``event_sale_session``, etc.) are
not audited for compatibility.
15 changes: 15 additions & 0 deletions event_multi_company/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
On the event form, the standard *Company* field is replaced by a *Companies*
many2many tags field (visible to users of the *Multi Companies* group).

* Leave it empty → event accessible from every company (legacy behaviour).
* Pick one or several companies → event accessible only to users of those
companies.

If the ``website_event`` module is installed:

* An event with empty ``company_ids`` is displayed on every website.
* An event with one or more companies is only displayed on the websites of
those companies.
* If you also set the per-event *Website* field, the event is restricted to
that single website. The website's company must be one of the event's
companies (upstream constraint).
Loading
Loading