diff --git a/mail_template_multi_company/README.rst b/mail_template_multi_company/README.rst new file mode 100644 index 00000000000..4893ea24154 --- /dev/null +++ b/mail_template_multi_company/README.rst @@ -0,0 +1,100 @@ +=========================== +Mail Template Multi Company +=========================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/15.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-15-0/multi-company-15-0-mail_template_multi_company + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/133/15.0 + :alt: Try me on Runbot + +|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 `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Olivier Laurent +* Souheil Bejaoui +* Andrea Stirpe + +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 `__: + +|maintainer-Olivier-LAURENT| + +This module is part of the `OCA/multi-company `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_template_multi_company/__init__.py b/mail_template_multi_company/__init__.py new file mode 100644 index 00000000000..c5aa16deafb --- /dev/null +++ b/mail_template_multi_company/__init__.py @@ -0,0 +1,10 @@ +from . import models + + +def post_init_hook(cr, registry): + """We should not set the company by default on all existing mail templates + when installing this module. Because many standard template need not be + specialized by company. + OTOH, when this module is installed it makes sense that new templates + being created by users have a company set by default.""" + cr.execute("UPDATE mail_template SET company_id=null") diff --git a/mail_template_multi_company/__manifest__.py b/mail_template_multi_company/__manifest__.py new file mode 100644 index 00000000000..fc9d25fcdab --- /dev/null +++ b/mail_template_multi_company/__manifest__.py @@ -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": "16.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"], +} diff --git a/mail_template_multi_company/i18n/es.po b/mail_template_multi_company/i18n/es.po new file mode 100644 index 00000000000..d7e970c3ad6 --- /dev/null +++ b/mail_template_multi_company/i18n/es.po @@ -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 \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" diff --git a/mail_template_multi_company/i18n/mail_template_multi_company.pot b/mail_template_multi_company/i18n/mail_template_multi_company.pot new file mode 100644 index 00000000000..8b5e9d45515 --- /dev/null +++ b/mail_template_multi_company/i18n/mail_template_multi_company.pot @@ -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 15.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 "" diff --git a/mail_template_multi_company/i18n/nl.po b/mail_template_multi_company/i18n/nl.po new file mode 100644 index 00000000000..3619108c28b --- /dev/null +++ b/mail_template_multi_company/i18n/nl.po @@ -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 \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" diff --git a/mail_template_multi_company/models/__init__.py b/mail_template_multi_company/models/__init__.py new file mode 100644 index 00000000000..44e83956ebe --- /dev/null +++ b/mail_template_multi_company/models/__init__.py @@ -0,0 +1 @@ +from . import mail_template diff --git a/mail_template_multi_company/models/mail_template.py b/mail_template_multi_company/models/mail_template.py new file mode 100644 index 00000000000..10d3622f050 --- /dev/null +++ b/mail_template_multi_company/models/mail_template.py @@ -0,0 +1,14 @@ +# 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", + ) diff --git a/mail_template_multi_company/readme/CONFIGURE.rst b/mail_template_multi_company/readme/CONFIGURE.rst new file mode 100644 index 00000000000..3f2c3793391 --- /dev/null +++ b/mail_template_multi_company/readme/CONFIGURE.rst @@ -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 diff --git a/mail_template_multi_company/readme/CONTRIBUTORS.rst b/mail_template_multi_company/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..5bebd7d5590 --- /dev/null +++ b/mail_template_multi_company/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Olivier Laurent +* Souheil Bejaoui +* Andrea Stirpe +* Alberto Nieto de Pablos (https://braintec.com) diff --git a/mail_template_multi_company/readme/DESCRIPTION.rst b/mail_template_multi_company/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..74ba8da34a1 --- /dev/null +++ b/mail_template_multi_company/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module add multi-company management to mail templates. diff --git a/mail_template_multi_company/readme/USAGE.rst b/mail_template_multi_company/readme/USAGE.rst new file mode 100644 index 00000000000..4ccfff20d4d --- /dev/null +++ b/mail_template_multi_company/readme/USAGE.rst @@ -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 diff --git a/mail_template_multi_company/security/mail_template.xml b/mail_template_multi_company/security/mail_template.xml new file mode 100644 index 00000000000..8b173000328 --- /dev/null +++ b/mail_template_multi_company/security/mail_template.xml @@ -0,0 +1,12 @@ + + + + + Mail Template multi-company + + + ['|',('company_id','=',False),('company_id','in',company_ids)] + + + diff --git a/mail_template_multi_company/static/description/icon.png b/mail_template_multi_company/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/mail_template_multi_company/static/description/icon.png differ diff --git a/mail_template_multi_company/static/description/index.html b/mail_template_multi_company/static/description/index.html new file mode 100644 index 00000000000..861a03a892b --- /dev/null +++ b/mail_template_multi_company/static/description/index.html @@ -0,0 +1,444 @@ + + + + + + +Mail Template Multi Company + + + +
+

Mail Template Multi Company

+ + +

Beta License: AGPL-3 OCA/multi-company Translate me on Weblate Try me on Runbot

+

This module add multi-company management to mail templates.

+

Table of contents

+ +
+

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. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • ACSONE SA/NV
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

Olivier-LAURENT

+

This module is part of the OCA/multi-company project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/mail_template_multi_company/views/mail_template.xml b/mail_template_multi_company/views/mail_template.xml new file mode 100644 index 00000000000..b6775a6ae35 --- /dev/null +++ b/mail_template_multi_company/views/mail_template.xml @@ -0,0 +1,39 @@ + + + + + mail.template.form (in mail_template_multi_company) + mail.template + + + + + + + + + mail.template.search (in mail_template_multi_company) + mail.template + + + + + + + + + mail.template.tree (in mail_template_multi_company) + mail.template + + + + + + + + diff --git a/setup/mail_template_multi_company/odoo/addons/mail_template_multi_company b/setup/mail_template_multi_company/odoo/addons/mail_template_multi_company new file mode 120000 index 00000000000..cd24b2b2796 --- /dev/null +++ b/setup/mail_template_multi_company/odoo/addons/mail_template_multi_company @@ -0,0 +1 @@ +../../../../mail_template_multi_company \ No newline at end of file diff --git a/setup/mail_template_multi_company/setup.py b/setup/mail_template_multi_company/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/mail_template_multi_company/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)