Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e43e56b
[ADD] - Add multi-company management to mail templates
sbejaoui Jul 10, 2019
993f1bd
[FIX] - not set the company by default on all existing mail templates
sbejaoui Jul 29, 2019
3afd076
[ADD] icon.png
OCA-git-bot Oct 25, 2019
a250b64
[FIX] mail_template_multi_company
max3903 Nov 7, 2019
7c07889
pre-commit
astirpe Jul 10, 2020
8739383
[13.0][MIG] mail_template_multi_company
astirpe Jul 10, 2020
3188ce6
Added translation using Weblate (Spanish)
anasuarez1 Mar 9, 2021
aa53ccc
[14.0][MIG] - mail_template_multi_company
sbejaoui Jul 9, 2021
0f6bb33
[MIG] mail_template_multi_company: Migration to 15.0
JasminSForgeFlow Mar 10, 2022
a2e22e7
Update translation files
weblate Mar 7, 2023
9651b59
Added translation using Weblate (Dutch)
bosd Jun 23, 2023
eaa5ef8
[MIG] mail_template_multi_company: Migration to 16.0
BT-anieto Jul 18, 2023
ddf53e7
[UPD] Update mail_template_multi_company.pot
Aug 2, 2023
593cfa9
[UPD] README.rst
OCA-git-bot Aug 2, 2023
900bd58
[UPD] README.rst
OCA-git-bot Sep 3, 2023
9d2c5d3
Added translation using Weblate (Italian)
mymage Jan 19, 2024
071bf0c
Translated using Weblate (Italian)
mymage Jan 19, 2024
ede2aaf
[IMP] mail_template_multi_company: pre-commit auto fixes
BhaveshHeliconia Dec 23, 2024
5bff643
[MIG] mail_template_multi_company: Migration to 18.0
BhaveshHeliconia Dec 23, 2024
551331f
[UPD] Update mail_template_multi_company.pot
Feb 20, 2025
6bc8847
[BOT] post-merge updates
OCA-git-bot Feb 20, 2025
8b1e1be
[IMP] mail_template_multi_company: pre-commit auto fixes
stferraro Mar 6, 2026
d4c9cc2
[MIG] mail_template_multi_company: Migration to 19.0
stferraro Mar 6, 2026
43e6b47
[MIG] migrate module to 19.0 version
stferraro Mar 6, 2026
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
110 changes: 110 additions & 0 deletions mail_template_multi_company/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===========================
Mail Template Multi Company
===========================

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

.. |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-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/19.0/mail_template_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-19-0/multi-company-19-0-mail_template_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=19.0
:alt: Try me on Runboat

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

This module add multi-company management to mail templates.

**Table of contents**

.. contents::
:local:

Configuration
=============

- Go to *Settings > General Settings*
- Activate the multi-company
- Go to *Settings > User & Companies > Users*
- Select your user to edit it and active the multi-company

Usage
=====

- Go to *Settings*
- Activate the developer mode
- Go to *Settings > Technical > Email > Templates*
- Open a template and set the company field if the template is specific
to a company

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:%20mail_template_multi_company%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
-------

* ACSONE SA/NV

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

- Olivier Laurent <olivier.laurent@acsone.eu>
- Souheil Bejaoui <souheil.bejaoui@acsone.eu>
- Andrea Stirpe <a.stirpe@onestein.nl>
- Alberto Nieto de Pablos <alberto.nieto@braintec.com>
(https://braintec.com)
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

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.

.. |maintainer-Olivier-LAURENT| image:: https://github.com/Olivier-LAURENT.png?size=40px
:target: https://github.com/Olivier-LAURENT
:alt: Olivier-LAURENT

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-Olivier-LAURENT|

This module is part of the `OCA/multi-company <https://github.com/OCA/multi-company/tree/19.0/mail_template_multi_company>`_ project on GitHub.

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


def post_init_hook(env):
"""We should not set the company by default on all existing mail templates
when installing this module, as many standard templates do not need to
be company-specific.
Since Odoo 16.0, the default `company_id` on new mail templates has been `False`,
which aligns with this behavior. However, when users create new templates,
it is still reasonable to default to the current company if applicable."""
env.cr.execute("UPDATE mail_template SET company_id=null")
15 changes: 15 additions & 0 deletions mail_template_multi_company/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Mail Template Multi Company",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/multi-company",
"depends": ["mail"],
"post_init_hook": "post_init_hook",
"data": ["security/mail_template.xml", "views/mail_template.xml"],
"development_status": "Beta",
"maintainers": ["Olivier-LAURENT"],
}
27 changes: 27 additions & 0 deletions mail_template_multi_company/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_template_multi_company
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-03-09 17:45+0000\n"
"Last-Translator: Ana Suárez <ana.suarez@qubiq.es>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"

#. module: mail_template_multi_company
#: model:ir.model.fields,field_description:mail_template_multi_company.field_mail_template__company_id
msgid "Company"
msgstr "Compañía"

#. module: mail_template_multi_company
#: model:ir.model,name:mail_template_multi_company.model_mail_template
msgid "Email Templates"
msgstr "Plantillas de email"
27 changes: 27 additions & 0 deletions mail_template_multi_company/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_template_multi_company
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-01-19 19:35+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: mail_template_multi_company
#: model:ir.model.fields,field_description:mail_template_multi_company.field_mail_template__company_id
msgid "Company"
msgstr "Azienda"

#. module: mail_template_multi_company
#: model:ir.model,name:mail_template_multi_company.model_mail_template
msgid "Email Templates"
msgstr "Modelli e-mail"
24 changes: 24 additions & 0 deletions mail_template_multi_company/i18n/mail_template_multi_company.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_template_multi_company
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: mail_template_multi_company
#: model:ir.model.fields,field_description:mail_template_multi_company.field_mail_template__company_id
msgid "Company"
msgstr ""

#. module: mail_template_multi_company
#: model:ir.model,name:mail_template_multi_company.model_mail_template
msgid "Email Templates"
msgstr ""
27 changes: 27 additions & 0 deletions mail_template_multi_company/i18n/nl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_template_multi_company
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-06-23 19:09+0000\n"
"Last-Translator: Bosd <c5e2fd43-d292-4c90-9d1f-74ff3436329a@anonaddy.me>\n"
"Language-Team: none\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: mail_template_multi_company
#: model:ir.model.fields,field_description:mail_template_multi_company.field_mail_template__company_id
msgid "Company"
msgstr "Bedrijf"

#. module: mail_template_multi_company
#: model:ir.model,name:mail_template_multi_company.model_mail_template
msgid "Email Templates"
msgstr "Email Sjablonen"
1 change: 1 addition & 0 deletions mail_template_multi_company/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import mail_template
13 changes: 13 additions & 0 deletions mail_template_multi_company/models/mail_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class MailTemplate(models.Model):
_inherit = "mail.template"

company_id = fields.Many2one(
"res.company",
ondelete="set null",
)
3 changes: 3 additions & 0 deletions mail_template_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"
4 changes: 4 additions & 0 deletions mail_template_multi_company/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Go to *Settings \> General Settings*
- Activate the multi-company
- Go to *Settings \> User & Companies \> Users*
- Select your user to edit it and active the multi-company
6 changes: 6 additions & 0 deletions mail_template_multi_company/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Olivier Laurent \<<olivier.laurent@acsone.eu>\>
- Souheil Bejaoui \<<souheil.bejaoui@acsone.eu>\>
- Andrea Stirpe \<<a.stirpe@onestein.nl>\>
- Alberto Nieto de Pablos \<<alberto.nieto@braintec.com>\>
(<https://braintec.com>)
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
1 change: 1 addition & 0 deletions mail_template_multi_company/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module add multi-company management to mail templates.
5 changes: 5 additions & 0 deletions mail_template_multi_company/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Go to *Settings*
- Activate the developer mode
- Go to *Settings \> Technical \> Email \> Templates*
- Open a template and set the company field if the template is specific
to a company
12 changes: 12 additions & 0 deletions mail_template_multi_company/security/mail_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2017 ACSONE SA/NV
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="mail_template_company_rule" model="ir.rule">
<field name="name">Mail Template multi-company</field>
<field name="model_id" ref="mail.model_mail_template" />
<field name="domain_force">
['|',('company_id','=',False),('company_id','in',company_ids)]
</field>
</record>
</odoo>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading