diff --git a/mail_server_user/README.rst b/mail_server_user/README.rst new file mode 100644 index 0000000000..ba3dd3a2ac --- /dev/null +++ b/mail_server_user/README.rst @@ -0,0 +1,82 @@ +===================== +Email Server For User +===================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f4f4347f0f16244f1af534d28eec9d0e38bfc4a37b39fa6ddfe410939e91b128 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fsocial-lightgray.png?logo=github + :target: https://github.com/OCA/social/tree/16.0/mail_server_user + :alt: OCA/social +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_server_user + :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/social&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Allows users to add their own outgoing mail server from the user preferences. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +#. There's a **Outgoing Email Server** option in **User Preferences**, where you can +configure your own mail server.Make sure that the **From Filtering** on the outgoing email server is set as your email if its supposed to be used only for your emails. + +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 +~~~~~~~ + +* Onestein + +Contributors +~~~~~~~~~~~~ + +* `Onestein `__ + +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/social `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_server_user/__init__.py b/mail_server_user/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/mail_server_user/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mail_server_user/__manifest__.py b/mail_server_user/__manifest__.py new file mode 100644 index 0000000000..2aba9ca861 --- /dev/null +++ b/mail_server_user/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2024 Onestein B.V. +# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Email Server For User", + "summary": "Allows users to add their own outgoing mail server from the user preferences.", + "version": "16.0.1.0.0", + "category": "Social Network", + "website": "https://github.com/OCA/social", + "author": ("Onestein, " "Odoo Community Association (OCA)"), + "license": "LGPL-3", + "application": False, + "installable": True, + "depends": ["base", "mail"], + "data": [ + "security/ir.model.access.csv", + "security/res_groups.xml", + "views/res_users_view.xml", + ], +} diff --git a/mail_server_user/models/__init__.py b/mail_server_user/models/__init__.py new file mode 100644 index 0000000000..5ab805590d --- /dev/null +++ b/mail_server_user/models/__init__.py @@ -0,0 +1,2 @@ +from . import ir_mail_server +from . import res_users diff --git a/mail_server_user/models/ir_mail_server.py b/mail_server_user/models/ir_mail_server.py new file mode 100644 index 0000000000..6949a55f4f --- /dev/null +++ b/mail_server_user/models/ir_mail_server.py @@ -0,0 +1,12 @@ +# Copyright 2024 Onestein B.V. +# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import fields, models + + +class IrMailServer(models.Model): + _inherit = "ir.mail_server" + + smtp_user = fields.Char(groups="base.group_system,base.group_user") + smtp_pass = fields.Char(groups="base.group_system,base.group_user") + smtp_ssl_certificate = fields.Binary(groups="base.group_system,base.group_user") + smtp_ssl_private_key = fields.Binary(groups="base.group_system,base.group_user") diff --git a/mail_server_user/models/res_users.py b/mail_server_user/models/res_users.py new file mode 100644 index 0000000000..ea7ab5665c --- /dev/null +++ b/mail_server_user/models/res_users.py @@ -0,0 +1,21 @@ +# Copyright 2024 Onestein B.V. +# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import fields, models + + +class ResUsers(models.Model): + _inherit = "res.users" + + ir_mail_server_id = fields.Many2one( + "ir.mail_server", + "Outgoing Email Server", + help="The email server with least Priority would be used.Make sure the From filtering is set to your email", + ) + + @property + def SELF_READABLE_FIELDS(self): + return super().SELF_READABLE_FIELDS + ["ir_mail_server_id"] + + @property + def SELF_WRITEABLE_FIELDS(self): + return super().SELF_WRITEABLE_FIELDS + ["ir_mail_server_id"] diff --git a/mail_server_user/readme/CONTRIBUTORS.rst b/mail_server_user/readme/CONTRIBUTORS.rst new file mode 100755 index 0000000000..ec57549307 --- /dev/null +++ b/mail_server_user/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* `Onestein `__ diff --git a/mail_server_user/readme/DESCRIPTION.rst b/mail_server_user/readme/DESCRIPTION.rst new file mode 100755 index 0000000000..ffaf35f73a --- /dev/null +++ b/mail_server_user/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Allows users to add their own outgoing mail server from the user preferences. \ No newline at end of file diff --git a/mail_server_user/readme/USAGE.rst b/mail_server_user/readme/USAGE.rst new file mode 100644 index 0000000000..9b2cbaef07 --- /dev/null +++ b/mail_server_user/readme/USAGE.rst @@ -0,0 +1,2 @@ +#. There's a **Outgoing Email Server** option in **User Preferences**, where you can +configure your own mail server.Make sure that the **From Filtering** on the outgoing email server is set as your email if its supposed to be used only for your emails. diff --git a/mail_server_user/security/ir.model.access.csv b/mail_server_user/security/ir.model.access.csv new file mode 100644 index 0000000000..1831f1b50f --- /dev/null +++ b/mail_server_user/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_ir_mail_server_user,access_ir_mail_server_user,base.model_ir_mail_server,base.group_user,1,1,1,1 diff --git a/mail_server_user/security/res_groups.xml b/mail_server_user/security/res_groups.xml new file mode 100644 index 0000000000..7076b3aef0 --- /dev/null +++ b/mail_server_user/security/res_groups.xml @@ -0,0 +1,49 @@ + + + Access Outgoing Mail Server + + + + + + + + + ir.mail.server.user.rule + + + ['|',('from_filter', '=', user.email),('create_uid','=',user.id)] + + + + + + + + + + ir.mail.server.group_system.rule + + + [(1,'=',1)] + + + + + + + + diff --git a/mail_server_user/static/description/icon.png b/mail_server_user/static/description/icon.png new file mode 100755 index 0000000000..3a0328b516 Binary files /dev/null and b/mail_server_user/static/description/icon.png differ diff --git a/mail_server_user/static/description/index.html b/mail_server_user/static/description/index.html new file mode 100644 index 0000000000..50f831affd --- /dev/null +++ b/mail_server_user/static/description/index.html @@ -0,0 +1,429 @@ + + + + + +Email Server For User + + + +
+

Email Server For User

+ + +

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

+

Allows users to add their own outgoing mail server from the user preferences.

+

Table of contents

+ +
+

Usage

+

#. There’s a Outgoing Email Server option in User Preferences, where you can +configure your own mail server.Make sure that the From Filtering on the outgoing email server is set as your email if its supposed to be used only for your emails.

+
+
+

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

+
    +
  • Onestein
  • +
+
+ +
+

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.

+

This module is part of the OCA/social project on GitHub.

+

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

+
+
+
+ + diff --git a/mail_server_user/views/res_users_view.xml b/mail_server_user/views/res_users_view.xml new file mode 100644 index 0000000000..c9de460543 --- /dev/null +++ b/mail_server_user/views/res_users_view.xml @@ -0,0 +1,20 @@ + + + + + Add outgoing mail server to user preferences form + + res.users + + + + + + + + diff --git a/setup/mail_server_user/odoo/addons/mail_server_user b/setup/mail_server_user/odoo/addons/mail_server_user new file mode 120000 index 0000000000..97c4880be1 --- /dev/null +++ b/setup/mail_server_user/odoo/addons/mail_server_user @@ -0,0 +1 @@ +../../../../mail_server_user \ No newline at end of file diff --git a/setup/mail_server_user/setup.py b/setup/mail_server_user/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/mail_server_user/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)