diff --git a/mail_template_operating_unit/README.rst b/mail_template_operating_unit/README.rst new file mode 100644 index 0000000000..534313d2f0 --- /dev/null +++ b/mail_template_operating_unit/README.rst @@ -0,0 +1,97 @@ +============================ +Mail Template Operating Unit +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d2e4748608ceee5c3714ba488656d7e63c4c939f851b1d9329e6219f59340112 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Foperating--unit-lightgray.png?logo=github + :target: https://github.com/OCA/operating-unit/tree/15.0/mail_template_operating_unit + :alt: OCA/operating-unit +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/operating-unit-15-0/operating-unit-15-0-mail_template_operating_unit + :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/operating-unit&target_branch=15.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module introduces the following features: + +* Adds the Operating Unit (OU) to the Email Templates. +* The user’s default Operating Unit (OU) is proposed at the time of creating the Email Template. +* Security rules are defined to ensure that users can only see the Email Template of that Operating Units in which they are allowed access to. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Admin: In Debug Mode, Go to Settings->Technical->Email->Templates +* User: Create an email message and save as a template. +* You only see the Email of your operating units. +* It is assigned to your default operating unit. + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Pavlov Media + +Contributors +~~~~~~~~~~~~ + +* Patrick Wilson +* Freni Patel + +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-patrickrwilson| image:: https://github.com/patrickrwilson.png?size=40px + :target: https://github.com/patrickrwilson + :alt: patrickrwilson + +Current `maintainer `__: + +|maintainer-patrickrwilson| + +This module is part of the `OCA/operating-unit `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_template_operating_unit/__init__.py b/mail_template_operating_unit/__init__.py new file mode 100644 index 0000000000..a5a54f4004 --- /dev/null +++ b/mail_template_operating_unit/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2020 Pavlov Media +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). + +from . import models diff --git a/mail_template_operating_unit/__manifest__.py b/mail_template_operating_unit/__manifest__.py new file mode 100644 index 0000000000..e51c876b5e --- /dev/null +++ b/mail_template_operating_unit/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright (C) 2020 Pavlov Media +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). + +{ + "name": "Mail Template Operating Unit", + "version": "15.0.1.0.0", + "author": "Pavlov Media, " "Odoo Community Association (OCA)", + "license": "LGPL-3", + "website": "https://github.com/OCA/operating-unit", + "category": "Base", + "depends": [ + "operating_unit", + "mail", + ], + "data": [ + "views/mail_template_view.xml", + "security/mail_security.xml", + ], + "installable": True, + "maintainers": ["patrickrwilson"], +} diff --git a/mail_template_operating_unit/i18n/it.po b/mail_template_operating_unit/i18n/it.po new file mode 100644 index 0000000000..3bc1960839 --- /dev/null +++ b/mail_template_operating_unit/i18n/it.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_template_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-07-23 17:25+0000\n" +"Last-Translator: mymage \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 5.10.4\n" + +#. module: mail_template_operating_unit +#: model:ir.model.fields,field_description:mail_template_operating_unit.field_mail_template__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: mail_template_operating_unit +#: model:ir.model,name:mail_template_operating_unit.model_mail_template +msgid "Email Templates" +msgstr "Modelli e-mail" + +#. module: mail_template_operating_unit +#: model:ir.model.fields,field_description:mail_template_operating_unit.field_mail_template__id +msgid "ID" +msgstr "ID" + +#. module: mail_template_operating_unit +#: model:ir.model.fields,field_description:mail_template_operating_unit.field_mail_template____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: mail_template_operating_unit +#: model:ir.model.fields,field_description:mail_template_operating_unit.field_mail_template__operating_unit_id +msgid "Operating Unit" +msgstr "Unità operativa" diff --git a/mail_template_operating_unit/i18n/mail_template_operating_unit.pot b/mail_template_operating_unit/i18n/mail_template_operating_unit.pot new file mode 100644 index 0000000000..d936c44869 --- /dev/null +++ b/mail_template_operating_unit/i18n/mail_template_operating_unit.pot @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_template_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.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_operating_unit +#: model:ir.model.fields,field_description:mail_template_operating_unit.field_mail_template__display_name +msgid "Display Name" +msgstr "" + +#. module: mail_template_operating_unit +#: model:ir.model,name:mail_template_operating_unit.model_mail_template +msgid "Email Templates" +msgstr "" + +#. module: mail_template_operating_unit +#: model:ir.model.fields,field_description:mail_template_operating_unit.field_mail_template__id +msgid "ID" +msgstr "" + +#. module: mail_template_operating_unit +#: model:ir.model.fields,field_description:mail_template_operating_unit.field_mail_template____last_update +msgid "Last Modified on" +msgstr "" + +#. module: mail_template_operating_unit +#: model:ir.model.fields,field_description:mail_template_operating_unit.field_mail_template__operating_unit_id +msgid "Operating Unit" +msgstr "" diff --git a/mail_template_operating_unit/models/__init__.py b/mail_template_operating_unit/models/__init__.py new file mode 100644 index 0000000000..a312c93da5 --- /dev/null +++ b/mail_template_operating_unit/models/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2020 Pavlov Media +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). + +from . import mail diff --git a/mail_template_operating_unit/models/mail.py b/mail_template_operating_unit/models/mail.py new file mode 100644 index 0000000000..cbae57a451 --- /dev/null +++ b/mail_template_operating_unit/models/mail.py @@ -0,0 +1,16 @@ +# Copyright (C) 2020 Pavlov Media +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). + +from odoo import fields, models + + +class MailTemplate(models.Model): + _inherit = "mail.template" + + operating_unit_id = fields.Many2one( + comodel_name="operating.unit", + string="Operating Unit", + default=lambda self: self.env["res.users"].operating_unit_default_get( + self._uid + ), + ) diff --git a/mail_template_operating_unit/readme/CONTRIBUTORS.rst b/mail_template_operating_unit/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..7e58aa1a2d --- /dev/null +++ b/mail_template_operating_unit/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Patrick Wilson +* Freni Patel diff --git a/mail_template_operating_unit/readme/DESCRIPTION.rst b/mail_template_operating_unit/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..f55828b82a --- /dev/null +++ b/mail_template_operating_unit/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +This module introduces the following features: + +* Adds the Operating Unit (OU) to the Email Templates. +* The user’s default Operating Unit (OU) is proposed at the time of creating the Email Template. +* Security rules are defined to ensure that users can only see the Email Template of that Operating Units in which they are allowed access to. diff --git a/mail_template_operating_unit/readme/USAGE.rst b/mail_template_operating_unit/readme/USAGE.rst new file mode 100644 index 0000000000..2fa9d2a574 --- /dev/null +++ b/mail_template_operating_unit/readme/USAGE.rst @@ -0,0 +1,4 @@ +* Admin: In Debug Mode, Go to Settings->Technical->Email->Templates +* User: Create an email message and save as a template. +* You only see the Email of your operating units. +* It is assigned to your default operating unit. diff --git a/mail_template_operating_unit/security/mail_security.xml b/mail_template_operating_unit/security/mail_security.xml new file mode 100644 index 0000000000..8ad23981f9 --- /dev/null +++ b/mail_template_operating_unit/security/mail_security.xml @@ -0,0 +1,17 @@ + + + + + ['|', ('operating_unit_id','=',False), ('operating_unit_id','in',user.operating_unit_ids.ids)] + + Mail Template Operating Unit + + + + + + + diff --git a/mail_template_operating_unit/static/description/icon.png b/mail_template_operating_unit/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/mail_template_operating_unit/static/description/icon.png differ diff --git a/mail_template_operating_unit/static/description/index.html b/mail_template_operating_unit/static/description/index.html new file mode 100644 index 0000000000..0cc354bd1a --- /dev/null +++ b/mail_template_operating_unit/static/description/index.html @@ -0,0 +1,441 @@ + + + + + +Mail Template Operating Unit + + + +
+

Mail Template Operating Unit

+ + +

Beta License: LGPL-3 OCA/operating-unit Translate me on Weblate Try me on Runboat

+

This module introduces the following features:

+
    +
  • Adds the Operating Unit (OU) to the Email Templates.
  • +
  • The user’s default Operating Unit (OU) is proposed at the time of creating the Email Template.
  • +
  • Security rules are defined to ensure that users can only see the Email Template of that Operating Units in which they are allowed access to.
  • +
+

Table of contents

+ +
+

Usage

+
    +
  • Admin: In Debug Mode, Go to Settings->Technical->Email->Templates
  • +
  • User: Create an email message and save as a template.
  • +
  • You only see the Email of your operating units.
  • +
  • It is assigned to your default operating unit.
  • +
+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Pavlov Media
  • +
+
+ +
+

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:

+

patrickrwilson

+

This module is part of the OCA/operating-unit project on GitHub.

+

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

+
+
+
+ + diff --git a/mail_template_operating_unit/views/mail_template_view.xml b/mail_template_operating_unit/views/mail_template_view.xml new file mode 100644 index 0000000000..f1d10d10d0 --- /dev/null +++ b/mail_template_operating_unit/views/mail_template_view.xml @@ -0,0 +1,32 @@ + + + + Email Template Form + mail.template + + + + + + + + + + Email Templates + mail.template + + + + + + + + diff --git a/setup/mail_template_operating_unit/odoo/addons/mail_template_operating_unit b/setup/mail_template_operating_unit/odoo/addons/mail_template_operating_unit new file mode 120000 index 0000000000..46fd7f39a4 --- /dev/null +++ b/setup/mail_template_operating_unit/odoo/addons/mail_template_operating_unit @@ -0,0 +1 @@ +../../../../mail_template_operating_unit \ No newline at end of file diff --git a/setup/mail_template_operating_unit/setup.py b/setup/mail_template_operating_unit/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/mail_template_operating_unit/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)